Question:
Need to store 1 million images in linux..How?
Ratheesh K
2010-08-02 15:03:56 UTC
I am designing a website which will potentially have millions of images. Whats the best way to arrange them..All of the images are uploaded by some users. I am thinking of creating a folder structure with their user id and put the image in it..Does it make any server issue..like maximum number of folders or server performance..Please let me know if you can think of some best architecture...?

Another way I am thinking was:
create folder from a to z and inside I will create user's folder and keep the images

Thank you for your valuable suggestion


I will use Linux file system..php to upload files, gd2 to resize images.
Three answers:
Germann A
2010-08-02 15:46:24 UTC
If you expect each user to have 1 million images than you will have to store them in few dirs (folders)

There are few discussions that you can find on Google about this:

http://www.techtalkz.com/suse-linux/156660-maximum-amount-files-per-directory.html

http://www.google.co.uk/search?q=linux+os+max+files+per+directory&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a



200 dirs with 5000 files each will provide considerably better performance than 1 dir with 1million files.
?
2010-08-02 23:01:17 UTC
You can also store images in a database, which would give you some of the advantages of working with data inside a database, but I'm not sure if it would be a slow or heavily resource demanding solution. It would be great if someone could point out if using a database for storing images in a case like this one is a good idea or not.
Lyn
2010-08-02 22:05:37 UTC
I would use a external hard drive and get a programmer to install a flickr script or photo sharing website on to a private server and upload 1000 images to get the website going.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...