Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best format to store images in a database?

What is the best format to store images in a database, such as binary,base64...etc, for optimal speed/size.

like image 763
teh_noob Avatar asked Feb 07 '09 02:02

teh_noob


2 Answers

Blob is the answer for your question.

Instead of storing image to database directly you can store the image in hard disk And store the filename in database.I think this way is appropriate.Performance wise this is good.

like image 177
DonX Avatar answered Sep 22 '22 00:09

DonX


Microsoft's advice for SQL Server used to be, for speed and size, store images in the file system, with links in the database. I think they've softened their preference a bit, but I still consider it a better idea certainly for size, since it will take up no space in the database.

like image 31
dkretz Avatar answered Sep 26 '22 00:09

dkretz