Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing PDFs in the database?

Status
Not open for further replies.

hapax

Programmer
Nov 10, 2006
105
US
For a website, what are the pros and cons of putting PDFs in a SQL Server database, versus just storing them in a web server directory?

So far I've only ever put text in a database, but I understand you can also put PDFs, images, etc in there.

I need to store about 1000 PDFs for use in my web app. Users will also need to add new ones. It seems simpler to track them if I put them in the db, but it also seems inefficient somehow to me.
 
You can store PDFs, images etc in the db and there are pros and cons. It all depends on your needs. In your case you are not storing that many, unless they are huge, but the cost of Disk space is cheap. Also, it does make it easier to know what docs, images you have and delete them when needed etc. Storing them in the file system becomes a nightmare to maintain especially when you have a lot of them and are also adding and deleting them often.
I work for a major real estate company and we store all our photos, and there are tons of them, on the file system. It is a nightmare maintaining them because we often add and delete images and we also have 4 image servers. So, we have many jobs that run to delete old photos etc. The process to do this is always a problem and needs to be tweaked. If they were in the DB, this nightmare would not exist. But at they time the system was developed, the cost of disc space was not as cheap as it is now.
 
Thanks for the info.

I guess db size could be an factor? 1000 PDFs at 1MB apiece, would be 1GB extra space to back up every day.

Or would SQL Server compress the PDF's size?
 
nope, no compression for sql server backups...

unless you're using 2008 enterprise, then you've got several options. although I'm not sure it'll work for pdf's though...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top