|
Best way to organize large numbers of files.
I have an application where a large number of files have to be stored on a server for reference purposes. These documents are named from 00000000 to 99999999. Currently there are only 2 million documents, but the count is increasing.
Storing all of these in one single directory seems to be relatively slow and occasionally I have noticed some entries simply disappearing. I always have a backup so putting them back in place is not a problem, but I don't like to have them disappear.
I am wondering if anyone knows what the best way to store these documents in the file system is. I need to have a balance between quick access, stability (nothing spontaneously disappearing), and ease of backup.
In a situation like this is it more efficient to create a directory hierarchy of say:
/1/2/3/4/5/12345678 for storing document number 12345678? If this is efficient is there a certain hierarchy point to stop for efficiency purposes? For instance is:
/1/2/3/4/5/12345678 better, worse, or no different from
/1/2/3/5/5/6/12345678
Thanks for any input.
|