Rule #1: Never store images in a database!

Next Rule

Storing images in a database

Why not store images in a database? One word. Bloat. Your database just gets bigger and BIGGER.

Images take up lots of disk storage. A relatively small image file that you routinely display on a webpage of just 500x 500px @24 bit is 500Kb! By way of comparison you can fit the entire text of a 400 page book in the same space!

The clue's in the name - database... not image base!

 

OK but.. you might find db image storage convenient for small enterprises, for employee avatars for example. You might even get away with it on a local network if the images are 100x100 8bit (8Kb) and if the company has only 20 employees. But scale that up to a million records and if your images are any size larger than a couple of Kb you're in trouble! SQL server saves images in 8Kb chunks so, hello disk fragmentation!

 

Worried about bytes? This is a handy calculator of image file sizes

Next Golden Rule of Web Imaging >>>