SQL Server was never designed to act as a file system, but many developers use it that way nonetheless. Countless content management systems rely on either shoving large files into blobs or storing filenames. The former has subpar performance while the later requires manually keeping the file system in sync.
SQL Server 2008 seeks to correct this by introducing a filestream option that can be applied to a varbinary(max) column. When used, binary data is stored as files in a private section of a NTFS drive. This offers the performance of a normal file but without the concurrency and backup issues.
The files are created in a folder specified by creating a new FileGroup. In order to link files to rows, each row must contain a GUID column. No explanation was given for why this was necessary in addition to the actual file column.
Community comments
about time
by joey jo jo shabadoo,
Re: about time
by Brian Lyttle,
about time
by joey jo jo shabadoo,
Your message is awaiting moderation. Thank you for participating in the discussion.
At least they are trying to address this. I've long been an advocate of keeping binary data out of the database and using the filesystem to um, store files. I've gotten weird looks in the past from Microsoft MVPs and n00bs alike. "Just put it in the database, that's what it's there for, it can handle it!".
Re: about time
by Brian Lyttle,
Your message is awaiting moderation. Thank you for participating in the discussion.
Well I there are limitations to both approaches. Depending on your needs, a single method of backup/restore may be useful. I think performance concerns can be dealt with in many situations, and you can end up with performance issues on the file system too. As with most things the fault is the people rather than the technology.