Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


The FILESTREAM Data Type in SQL Server 2008


The FILESTREAM Data Type in SQL Server 2008

Author
Message
Kevin Farlee
Kevin Farlee
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 14
Yes.
For larger blobs it's more efficient to use the GetPath() and Open SqlFilestream() functions to get an open file handle and use that to access the data under SQL control. For smaller blobs the overhead of opening and closing the file overwhelms the faster data transfer.



Kevin Farlee
SQL Server Storage Engine PM
Deepa Gheewala
Deepa Gheewala
SSC-Enthusiastic
SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)

Group: General Forum Members
Points: 124 Visits: 91
SQL SERVER has provided a way to handle files and backup - recovery problems.
Also it is recommended that this should be used when file size is above 1 MB.
Andrew..Peterson
Andrew..Peterson
Old Hand
Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)

Group: General Forum Members
Points: 344 Visits: 683
Designers of document storage and mgmt apps (with large document objects) had to decide where to store the objects. These included document management systems like LiveLink, and more recentlySharepointt.
As internet bandwidth increases, applications that use large files are expanding, including video and music files.

LiveLink, as a document management system supported both (either) the storing of documents in the database as blobs, or in external files. As some of the earlier comments noted, large blobs were slow, so most installations used external files. That allowed the database, which then only held meta-data, be be fairly small, fast, and to only require a modest server.

Naturally, maintaining the correct linkage between the external files and the internal database records added some additional overhead. But not really any more than the double-linked system the database engine uses to maintain page consistency.

Filestream gives you an option, but like all options, only use it if it makes sense, and meets the business objectives. My guess is that for many cases, storing files completely outside of the database (the current approach), and only storing the metadata in the database will tend to be the best approach.

The more you are prepared, the less you need it.
the_rs
the_rs
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 20
Andrew:

I agree with you that from a performance standpoint, storing these files in the native file system is the better option.

But then, data recoverability is an issue. I had worked on a project that managed cases in XML and the XML files were stored in Documentum. We had to minimize data loss (once-a-day backup was not acceptable) and you had buy a pricey third-party software to ensure that data loss was restricted to 15 minutes in case of data corruption/system outage etc.

Venki
Andrew..Peterson
Andrew..Peterson
Old Hand
Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)

Group: General Forum Members
Points: 344 Visits: 683
Yes, it really gets down to understanding both the requirements and the tools.
I see many troubled/problem applications/systems where lack of storage knowledge was the biggest problem with the system. Storage being both database and overall file system.

The more you are prepared, the less you need it.
dawidjordaan@gmail.com
dawidjordaan@gmail.com
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 459
Excellent article! Very well written and most of the advice in the comments are spot on.

I have a slightly off-topic question. We are currently still on SQL Server 2005. We will not move to SQL Server 2008 until at least Q2 2009.

I have to implement a system on SQL Server 2005 that basically mimics a document management system.

Do I save the BLOBs to a MAX field in the database or do I save the BLOB to the File System? Which method will be the easiest/less work to convert to FILESTREAM?

Thank you in advance.
jain.robin15
jain.robin15
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 4
Can I use queries with FREETEXT, CONTAINS, NEAR etc. with data(content of text files or doc files) stored using sql filestream?
maria.rivera
maria.rivera
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 26
Great article! Have a question for you... Can I attach a file saved on a Filestream column to an email sent with sp_send_dbmail?

Any insight will be greatly appreciated!

-M
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search