saving images and documents

G

Guest

Which is better, I know there are factors that effect this. A.) to save the
images and documents by uploading them to a server location and referencing
them via a DB table or B.) to save directly into the Sql Server table?
Using ASP.NET (VB.NET).
The images files will about 50KBs and the documents are about 1MB, on a 90%
locally used web application.
What are the benefits, and downfalls, of either strategy?

thanx.
 
S

Sahil Malik

Chris,

My 2c ----

Plusses for approach B)
Never have to worry about duplicate image filenames etc.
Never have to worry about access permissions.
Never have to worry about security outside of your ASP.NET app.
Easy porting because it's all in one place (the db).
Transactions dude ... :) that,s a nice nice thing !!

Downsides for approach b)
First of all consider the cost of serializing the document/image into the
blob.
Second think about timeouts and broken streams when retreiving larger datas
that aren't quite one shot.
Third, your larger files will go from d/b to web server as 4 kb chunks and
each chunk will require handshaking - too much overhead - you decide.
Fourth, What really guarantees that you will never run across an image >
50KB or document > 1 MB
Fifth, Sql server is gonna break the image/document up so it fits inside
it's small small pages, and obviously it'll have to peice it together in a
select query.

If I had to, I'd say, keep the documents out of the sql server and images
in.

BTW, Sql Server hosting images - performance can suck - but modern databases
are much hi-fi than we give them credit for. Check this out -
http://research.microsoft.com/research/pubs/view.aspx?msr_tr_id=MSR-TR-99-29
(in short, terraserver.microsoft.com stored images in Sql Server - and that
was a LOT of data, but then they must have some serious beefy servers
running that site too).

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
 

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

Top