I’m working on a project in ASP.Net that users can share photos about their trips. The users will have different trips, such as Tokyo – 11-01-2011, Sydney – 19-02-2012. So what is the best structure to store these images;
- Storing all images in one folder called Users Trip Photos.
- Creating specific folder for each user’s photos.
- Creating specific folder for each Trip.
My question is not just about this project. I wonder what should be the image structure in a web site.
If you are planning to eventually hold a large number of images, you might want to look at restructuring your folder structure to speed up the image retrieval. Storing all your images in a single folder will eventually really slow things down when the system has to look through a list of >2K files on your file system.
One way I have seen it broken down is such:
Assuming each of your site user’s has a unique id, you can use this to structure your folders. For example, a user’s photos (id 12345) will be located in UploadedImages/1/2/3/4/5/12345. If you break out your folder structure this way, the system will only have to traverse a max of about 10 sub-folders in each folder to find the one it is looking for.
Is this feasible for your project?