A point of contention usually arises with the topic of relational databases and binary large object (BLOB) data: Is it better to integrate BLOBs within the database or store them in the file system? Each method has its advantages and disadvantages.

Storing BLOB data such as images, audio files, and executable files in the database with typical text and numeric data lets you keep all related information for a given database entity together. And this approach enables easy search and retrieval of the BLOB data; you simply query its related text information. However, storing BLOB data can dramatically increase the size of your databases.

The common alternative to this technique is storing binary files outside the database, then including as data in the database a file path or URL to the object. This separate storage method has a couple of advantages over integrating BLOB data within the database. It’s somewhat faster because reading data from the file system involves a bit less overhead than reading data from a database. And without the BLOBs, your databases tend to be smaller. However, you must manually create and maintain a link between the database and external file system files, which have the potential to get out of sync. In addition, you usually need a unique naming or storage scheme for the OS files to clearly identify the potentially hundreds or even thousands of BLOB files. Storing BLOB data within the database eliminates these problems by letting you store BLOB data along with its related relational data.

End of Article




Post Your Comments Here

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now

Reader Comments

might want to update this article with new sql 2008 info. filestream and such

markeboyle

Article Rating 5 out of 5

Hi markeboyle,

Thanks so much for your feedback about this article. We will definitely keep your comment in mind when we are scheduling content for future issues of SQL Server Magazine. Thanks again!

Megan Bearly Associate Editor, SQL Server Magazine mbearly@sqlmag.com

meganbearly

Article Rating 5 out of 5

 
 

ADS BY GOOGLE