in reply to Poor Person's Database
However, if you insist on using a roll-your-own flat file system, and you're sure that you only need to key on the first word I do have a suggestion. Instead of using the entire word for a directory (i.e. /www/search/KEYWORD) you might want to take it a step further, and use subdirectories based on the first few letters of each keyword. Your structure would then look something like:
KEYWORD FILE dartboard => /www/search/d/a/rtboard.dat doghouse => /www/search/d/o/ghouse.dat dog => /www/search/d/o/g.dat do => /www/search/d/o.dat (note how the suffix avoids colliding with the 'o' directory)I'm guessing with a big dataset, you'll run into the limits of the number of entries in a single directory. (I hit that limit once on an old version of linux at 32,000) This way will speed up access (I think) and help you avoid the OS directory limits.
Again, I would use DBM if at all possible.
-Blake
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Poor Person's Database
by grinder (Bishop) on Jun 20, 2001 at 11:38 UTC |