The Old Storing Images in DB question

  • Thread starter Thread starter Spondishy
  • Start date Start date
S

Spondishy

Hi,

I've taken over a publishing application that stores images in a sql
server db. The architecture is basically many load balanced web servers
connecting to the db. When an image is pulled from the db it uses an
aspx page similar to this <img src="image.aspx?imgid=1" />

I realise there are trade offs between performance security etc, but I
think this is going to be a bottleneck in the app going forward. Is
there anything I can do to improve the output of the binary data from
the db? Any cacheing trick for example?

Thanks.
 
Is it a requirement that the images stay in the database? Ideally you'd
store them on the file system and keep the filename info in the database.

What you could do in your image.aspx page is pull the image from the
database and save it to a folder. Before images are pulled from the DB you
check to see if there is a stored version, and if there is write that
version to the stream instead of reading from the database.

You might want an "updated date" field with your images to ensure you can
always get from the database if the image has been updated since you stored
it.
 
Back
Top