Possible Duplicate:
Storing Images in DB – Yea or Nay?
Images in database vs file system
I’ve been developing a web application using RIA technologies (Flex + PHP + MySQL + Ajax) and now I’m in a dilemma about image files.
I use some images in my Flex app, so I think “it could be awesome if I store them into database, and then retrieve from it; consecuently, maintain process should be more easy”. But, here is my dilemma:
Should I store the physical URL of my images, or is going to be better if I store directly the image?
For example, should my Cars table looks like:
ID(autonumeric) |Source(text)
or like this?
ID(autonumeric) |Image(longblob or blob)
I know that here are cool people that can answer me this question, explaining me which is better and why 🙂
I personally recommend to Store Images in the database. Of course it both advantages and disadvantages.
Advantages of storing BLOB data in the database:
Disadvantages of Storing BLOB Data in the Database:
Carefully consider what resources might be better stored on the file system rather than in a database. Good examples are images that are typically referenced via HTTP HREF. This is because: