in reply to Need directory scheme to store 400,000 images

Your directory scheme is reasonable; this is similar to what CPAN uses for storing files in the authors' directory. You might check the CPAN.pm module in your installation for details on how to use this sort of scheme.

One difference is that takes the prefix of a file name, allowing the suffix to be of arbitrary length:

123.jpg -> /1/12/123.jpg 114884.jpg -> /1/11/114884.jpg
This has the advantage of (1) having a uniform algorithm over all files to generate the file path and (2) being exapndable in your case to beyond 1_000_000 files.

-Mark

Replies are listed 'Best First'.
Re: Re: Need directory scheme to store 400,000 images
by fglock (Vicar) on Apr 12, 2004 at 20:46 UTC

    The digits in the end of the number are more likely to be uniformly distributed:

    123.jpg -> /3/23/123.jpg 114884.jpg -> /4/84/114884.jpg