Disadvantages of storing images in a database?

Can anyone tell me about the disadvantages of storing images in a MySQL database?
Isn't it as efficient as storing images on a server? Will it take more time to upload images to disk storage and will it load a large database? Appreciate the help!

+3
source share
2 answers

One of the benefits that you get from storing images on disk is that you can directly serve them using a fast web server (nginx), which should not hit your code at all. Another is that you can more easily switch to CDN later if you need to.

+2
source

Of course, this can be a little slower than if you save them as files. It always depends on how many and how many images you have. We save profile images in the database and work perfectly. It also simplifies processing because you don’t have to worry about the file system, and if you back up the database, everything is prepared (is that a word?).

Assuming you are not facebook or flickr, I would not worry about that.

+2
source

Source: https://habr.com/ru/post/1766036/


All Articles