Give two reasons why storing product images JPEGs etc in the
Give two reasons why storing product images (JPEG\'s, etc.) in the database is not a good idea.
Solution
If you on occasion need to retrieve an image and it has to be available on several different web servers. But I think that\'s pretty much it.
If it doesn\'t have to be available on several servers, it\'s always better to put them in the file system.
If it has to be available on several servers and there\'s actually some kind of load in the system, you\'ll need some kind of distributed storage.
We\'re talking an edge case here, where you can avoid adding an additional level of complexity to your system by leveraging the database.
Other than that, don\'t do it.
I recommend storing images outside of the database. There are many reasons but some of the big ones are:
It is a lot easier to manage, view, and manipulate images that are on the file system. You can use standard command line tools (imagemagick to resize or crop for example) and image viewers.
It provides flexibility long term. As already mentioned, images can consume a lot of space and by keeping them separate you have a smaller database to deal with and more options for scaling down the road. You could for example move all your images to a completely separate server.
Blobs are often a \"gotcha\" item in many replication and backup solutions.
