Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: •Re: Need directory scheme to store 400,000 images

by markjugg (Curate)
on Apr 12, 2004 at 21:42 UTC ( [id://344541]=note: print w/replies, xml ) Need Help??


in reply to •Re: Need directory scheme to store 400,000 images
in thread Need directory scheme to store 400,000 images

We decided to use md5 over the other options. Some reasons included:
  • md5 creates a balanced tree. With the numerical way, directories would vary from having 1 to 10,000 files in them, assuming 3 levels of directories in the form "1/2/3".
  • IDs of less than 3 characters get treated the same way. (With the numerical version, files ended up in higher level directories, or got padded with zeros).
  • It's still not very hard to find a directory "by hand" if a programmer needs to do that. Using md5 on the ID on the command line will quickly reproduce the result. This would work as well:
    find ./uploads_dir -name '1234.jpg'

    I also found out we need to plan for more like 1.5 million images.

    • Comment on Re: •Re: Need directory scheme to store 400,000 images

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://344541]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-23 10:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found