Possible Duplicate:
what are the best tips for storing images in a database?

In those study cases of image storage,

  • An image that change only once in a while, if it changes at all (like an image for an article)
  • The image case from above is not only one image but over 10, that link to the same article
  • An image that have changes very often (like a banner image for a website)
  • The image above is huge

What is the best approach for each case? What is the "right/faster" way to do this task in each scenario ?


2 Answers 2


Sorry to provide a link only answer, but this microsoft research paper goes into great detail on the advantages of file system vs database for file storage:

To BLOB or Not To BLOB

  • How much has storage changed over the last 7 years? Commented Dec 10, 2012 at 19:44

My default answer to the default image storage question is to do both -- store the original in the database, but use caching to serve it out of the filesystem. It gives you all the advantages of the database -- that is transactional updates, easier backup management and transportability as you can just deploy from the database while also preserving the filesystem's advantages of speed of serving static content.

  • Hmm nice idea, the problem is the cost in server and database. In small projects, I think, this is the best idea. +1 Commented Dec 10, 2012 at 17:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.