The Old Storing Images in DB question

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.
 
A

Aidy

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top