InfoQ

News

New File Storage Mechanism for SQL Server

Posted by Jonathan Allen on Dec 03, 2007 06:09 AM

Community
.NET
Topics
SQL Server
Tags
SQL Server 2008

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.

2 comments

Reply

about time by joey jo jo shabadoo Posted Dec 3, 2007 8:09 AM
Re: about time by Brian Lyttle Posted Dec 3, 2007 8:49 PM
  1. Back to top

    about time

    Dec 3, 2007 8:09 AM by joey jo jo shabadoo

    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!".

  2. Back to top

    Re: about time

    Dec 3, 2007 8:49 PM by Brian Lyttle

    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!".


    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.

Exclusive Content

Clojure

Rich Hickey discusses Clojure features and syntax, example code, functional programming, concurrency semantics, transactions, software transactional memory, agents, implementation and pain points.

Composite Oriented Programming with Qi4j

We introduce the concept of Composite Oriented Programming, and show how it avoids the issues with OOP and reignites the hope of being able to compose domain models with reusable pieces.

Dan Farino About MySpace’s Architecture

Dan Farino talks about the system architecture and the challenges faced when building a very large online community. Dan explains how a .NET product scales on hundreds of servers.

Principles and Practices of Lean-Agile Software Development

Alan Shalloway, CEO and founder of Net Objectives, presents the Lean software development principles and practices and how they can benefit to Agile practitioners.

The Maxine VM

Bernd Mathiske discusses Maxine VM, Java compatibility, swapping major VM components, research areas, Object handling, code examples, optimizing compiler, snippets, bytecode generation, JNI and JIT.

Joe Armstrong About Erlang

Joe Armstrong speaks on various aspects of the Erlang language, presenting its roots, how it compares with other languages and why it has become popular these days.

The Limits of Code Optimization: a new Singleton Pattern Implementation

The java double-check singleton pattern is not thread safe and can’t be fixed. In this article, Dr. Alexey Yakubovich provides an implementation of the Singleton pattern that he claims is thread-safe.

Pressure and Performance – The CTO's Dilemma

Diana and Jim talk about patterns observed in CTOs' activity. CTOs emerge as real people caring for other people in their organization, and are put under a lot of pressure and constraints.