Is it better practice to store a lot of small PNG images (<5KB mostly) in my database as BLOBs or would it be better to store them as image files in a directory?
It depends on what is more important to you: speed or ease of access.
If you have an application in which you have to bind conceptually a picture to a record (eg. contacts application) I would go the dbms way. It may not be as fast (a very subjective matter), but it is much easier to handle.
It is also much simpler to store pictures in a dbms if you want to back up your data! (consider the fact you have to issue only ONE backup command and you have backed up ALL your data).
I suspect that you have a way to store other data which is bound to pictures. If this holds true then I would definitely go the dbms way. If this should not be true then don’t bother designing a schema, creating the dbms, creating connections, storing data… to much overhead!
Answered By – Savvas Sopiadis
Answer Checked By – Jay B. (BugsFixing Admin)