|
Posted by TW on 07/08/06 11:18
David T. Ashley wrote:
> "Richard Levasseur" <richardlev@gmail.com> wrote in message
> news:1152322021.658752.74530@b28g2000cwb.googlegroups.com...
> > Another option would be to name the file after the primary key, or
> > other unique index, of the table.
>
> The reason for the prime moduli directory scheme is that Unix directory
> operations become inefficient beyond a few hundred entries in a directory.
>
> The prime moduli scheme is designed to avoid this by filling up the
> lowest-level directories evenly.
>
> It isn't clear that naming the file after the primary key would have the
> same advantage.
>
> The example I gave was with three primes. In practice, one should use
> primes not larger than 200 and enough of them so that their product exceeds
> 2^32.
That is justa maintenance nightmare for the average person...Someone's
poor bastard's gonna go implement this technique to only realize that
s/he shot himself in the foot because they'll have to figure out what
folder to place an image into. What about when it's time to delete a
file? Now they'll have to script it out (if feasible). That's just too
much work for something that should simply be an intelligible file
structure.
Use that method if you find that you must, but 200 entries? That's on
the low side. I know a site right now with major traffic and about 4000
images in a single folder...it's hardly slow to serve them up.
Perhaps read operations don't suffer as much (or at all) as writes.
I've seen qmail fill a folder with 100,000+ files. Read access times
were just fine.
I'm all for efficient design, but practicality rules.
Navigation:
[Reply to this message]
|