DEV Community

Discussion on: Storing Image File (binary) vs Image Base64 in Database

Collapse
 
dmfay profile image
Dian Fay

Is referential integrity between images and other parts of your data model important? If so, you're probably alright but remember to store and index metadata to make searching the table efficient if you need to do that for any reason. You're not going to power something the scale of Google Image Search out of that but you almost certainly aren't trying to do that anyway.

If you don't need referential integrity or if you have a lot of image data coming, then you might be better off storing them on a distributed filesystem like Mongo's GridFS, or in someone's cloud.

Collapse
 
khophi profile image
KhoPhi

You're not going to power something the scale of Google Image Search out of that but you almost certainly aren't trying to do that anyway.

Of course, but from Ben's points below, I imagine even a slight growth in traffic could topple the system with embedded images.

then you might be better off storing them on a distributed filesystem like Mongo's GridFS, or in someone's cloud.

Yep. Thanks.