To Database or File System

  • I was looking for others thoughts on topic of saving pdf to Database or File System. Currently we save all documentation, (PDF), created by our application to Filesystem with PATH stored in Database. That way we can access a copy of the documentation readily to send copies or whatever.....

    The problem is the handling of that filesystem "Archive". If you should venture into one of those folders the time the system takes to generate the directory is enormous and "hungry on resource". We are looking at hundreds of thousands of files @ 30-70kb in size.

    I ask those with the experience of similar design, is it better to store the pdf in the Database or is it better to store to filesystem. I appreciate the question is a little open ended, but wondering what was the experience of others that started the way we did by saving to Filesystem then converting to Database.

    Obviously Database would grow significantly, but Backups and performance may / may not be improved.

    Hope question makes sense and appreciate any constructive feedback.

  • At only 30-70kb each I would look into storing them in the database in a VARBINARY(MAX) column provided the database is the only way people need to access the files directly, i.e. that people do not also need to be able to manage the files at the file system level. If they need to also be able to access the files on disk then what you have might be your best option in SQL 2005. For your issue about loading the directory with so many files, consider implementing a sub-folder structure to keep the files in any one folder down to a manageable size.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Thanks opc.three for your thoughts.

    We may need to email lost copies and print the PDF, but these are all functions we would have to write. I would envisage sticking the PDF in a seperate Archive DB to teh actual production database as this will cause the Database to grow significantly if we did databse the files.

    Access to the Filesystem would reduce to nothing the more we can get "done" within teh database.

    Again thank you for your input.

    Regards

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply