0

Possible Duplicate:
Storing a million images in the filesystem

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.

1 Answers1

4

Honestly, the way you arrange them should depend on what exactly you are doing with the pictures. Do you want them organized by user, or do you want them in a pool. How are you presenting the images. Also, how are you going to name the images? You could certainly do what you are asking about, though I wonder about the necessity of the extra level of a-z folders. That seems like a bit of unnecessary depth. You could also honestly put them all in one folder together and use UUIDs to name the pictures to ensure you don't have name collisions. Depending on how you want to manage them, you'll probably want to keep a database of the pictures to allow ease of access. If you provide more details on what you are wanting to do, we can provide more useful suggestions.

Tristan
  • 186