Can anyone please tell me the disadvantages of storing images in a MySQL database?
Is it not as efficient as storing the images on the server? Will it take longer for the images to download vs disk storage and will it put heavy load on the database? Appreciate the help!
相关问题
- Views base64 encoded blob in HTML with PHP
- How to get the background from multiple images by
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- NOT DISTINCT query in mySQL
One advantage you get from storing images on the disk is that you can serve them directly with a fast web server (nginx), which doesn't have to hit your code at all. Another one is that you can easier switch to a CDN later if you have to.
Of course it might be a little slower than if you save them as files. Always depends how big and how many images you have.
We store the profile images in the DB and that works fine. It also makes the handling easier, because you don't have to worry about the file system and if you backup the DB, everything is backuped (is that a word?).
Assuming you are not facebook or flickr I would not worry about it.