[dba-SQLServer] Graphics in SQL Server table

Steven W. Erbach serbach at new.rr.com
Wed Dec 1 08:15:24 CST 2004


Mark,

If you use the Stream method to store the PDFs then the database "bloat" pretty much goes away. Of course, you need to use the same method to read it back out and then feed it to Acrobat.

The main benefits of storing images in the db are: any queries you do will automagically include your images; backup is simplified; organization is simplified (I just couldn't face coming up with a method for keeping track of -- potentially -- 10's of thousands of images in the file system); and security is simplified. For example, your PDFs would need to be separately secured from the possibility of download. The SQL db already has that covered.

All for an "overhead" of about 18% as far as I can determine. That is, the table in which the images are stored is just 18% bigger than the combined file sizes. The table, of course, contains a primary key, foreign key, and a description.

I can't claim any great proficiency in this area. I'm still feeling my way. But it seems to me that image storage in a SQL Server db isn't that bad an idea. We'll see shortly.

Steve Erbach
Neenah, WI

> ------------Original Message------------
> From: Mark Breen <mark.breen at gmail.com>
> To: dba-sqlserver at databaseadvisors.com
> Date: Tue, Nov-30-2004 5:16 PM
> Subject: Re: [dba-SQLServer] Graphics in SQL Server table
> 
> Hello Steve,
> 
> Now that is interesting, but what I would really be interested in for
> a potential future project is (and I know this is a solution trying to
> find a problem), what do you think of storing a whole lots of PDF's in
> SQL?
> 
> Of course I can store them in the file system, but I am going to have
> to build a system that will track and print PDF's, your email has made
> me wonder whether there is any benefit in attempting to keep them in
> the db.
> 
> One thing that I will have to do in have a sort of in-form PDF viewer.
> 
> Again, there is no need to store them in the db, but I just thought it
> might be an idea.
> 
> Any thoughts?  Are you glad that you stored your gig's in the db, did
> you reap any benefit?
> 
> Thanks
> 
> Mark
> 





More information about the dba-SQLServer mailing list