0

Possible Duplicate:
How many files in a directory is too many?

I built custom software for an industry networking site using Doctrine ORM and Smarty.

My question is this, I just launched, and I have all image uploads going to:

/images/ - for the full size images
/images/thumbs/
/images/thumbs-mid/
/images/thumbs-small/

I've already got 50MB in image uploads in only 45 minutes. Is it a bad idea to let thousands of images pile up in one directory? Or should they be broken up into more directories? What do you suggest?

Thanks for any advice

  • Linux CENTOS 5 64bit
Community
  • 1
  • 1
Andrew Fashion
  • 215
  • 2
  • 10
  • depending on os\file-system there are limits to how many files you can have in a directory –  Aug 11 '11 at 04:47

1 Answers1

-4

I suggest you set a max size on image uploads and store them as blobs or binary data types in a relational database, this way you can keep more meta data about the image such as the user who uploaded how many times its been viewed and for db replication its a lot easier to backup a single db. I know MySQL supports this and although I'm not a fan of Microsoft they have a free edition of SQL Server Express that performs very well for storing and getting images from the db. If you decide to go the route of a file system you might also run into concurrency issues which a db will take care of for you.

Duncan Krebs
  • 3,366
  • 2
  • 33
  • 53
  • 2
    No, no. Store the images in a file directory, your os could have limits as @Dagon mentioned, then use sql to store meta info and a reference to the image location. – Matt R. Wilson Aug 11 '11 at 05:45