I am developing a site that lets people upload images. We resize each image to 4 sizes. We're expecting lots and lots of images and are considering ways to increase performance with regards to the file structure, as we don't really want one directory with 10000s of files. Anyone got any suggestions as to how we organise the files?
The options that seem obvious are
each user has own folder, and within that a folder for each size
(Each of the four folders could hold a lot of images)
/user_uploads/user01/ |-/size_thumb/ |-/size_small/ |-/size_medium/ |-/size_large/ /user_uploads/user02/ |-/size_thumb/ |-/size_small/ |-/size_medium/ |-/size_large/ etc etc
or each users photos stored in one folder per user (more photos per directory, but less overall directories)
/user_uploads/user01/ /user_uploads/user02/ etc etc
each photo stored by size
lots and lots of photos per directory (could have further subfolders by date?)
/user_uploads/small/ /user_uploads/medium/ /user_uploads/large/ /user_uploads/thumbs/
Anyone got any ideas? I think we'll probably go with
/user_uploads/userID/ unless anyone has any suggestions.
(Right now everything will be hosted on one computer, so we don't have to worry about files being on different servers)