Anonymous Asked in Cars &Transportation · 2 weeks ago

Is it bad to store images in database?

Storing images in a database table is not recommended. There are too many disadvantages to this approach. Storing the image data in the table requires the database server to process and traffic huge amounts of data that could be better spent on processing it is best suited to.


Why is it bad to store images in a database?

The problem with storing only filepaths to images in a database is that the database's integrity can no longer be forced.

Should images be stored in database or server?

Generally databases are best for data and the file system is best for files. It depends what you're planning to do with the image though. If you're storing images for a web page then it's best to store them as a file on the server. The web server will very quickly find an image file and send it to a visitor.

Is it bad practice to store images in MySQL?

There is no good or bad practice to store images (files) into a BLOB field. It is rather requirement dependent.

Is it good practice to store images in MySQL?

Yes, you can store images in the database, but it's not advisable in my opinion, and it's not general practice. A general practice is to store images in directories on the file system and store references to the images in the database.

Related Questions

Relevance
Write us your question, the answer will be received in 24 hours