Blob Storage


As announced in this previous post, a couple builds ago we released a new feature which lets you store your Binary Large Objects (a.k.a. blobs) in Windows Azure’s Blob Storage instead of inside your database.

As seen in this video, developers can now specify through their application configuration, at run time and without having to generate over nor compile over their sources, where they’d like their blobs to be loaded and stored from. Available configurations or either to store their blobs in database, in a Windows Azure Blob Storage Account, or on the server’s file system.

Here’s a set of application configuration illustrating how to configure the runtime where to store your blobs.

Here’s the default configuration of my Sample application: no specific binary service is specified, blobs are stored in my database.

<configuration>
  <configSections>
     <section name="Sample"type="CodeFluent.Runtime.CodeFluentConfigurationSectionHandler, CodeFluent.Runtime" />
  </configSections>
  <Sample connectionString="server=(local);database=Sample;Trusted_Connection=true" />
</configuration>

Now here’s the configuration but modified to use the Windows Azure Blob Storage for all my entities:

<configuration>
(…)
<Sample connectionString="server=(local);database=Sample;Trusted_Connection=true" binaryServicesTypeName="azure"
cloudStorageAccountConnectionString="DefaultEndpointsProtocol=http;AccountName=MyAccount;AccountKey=9K5cXEs+9zEcBXz9gqjp==" />
(…)
</configuration>

And now here’s the equivalent but to store them on the file system:

<configuration>
(…)
<Sample connectionString="server=(local);database=Sample;Trusted_Connection=true" binaryServicesTypeName="filesystem" fileSystemBlobStorageRootPath="C:\Blobs" />
(…)
</configuration>

Please note that the binary service both for file system and Windows Azure blob storage can be specified per entity as well:

<configuration>
(…)
<Sample connectionString="server=(local);database=Sample;Trusted_Connection=true">
  <binaryServices entityFullTypeName="Sample.Customer" binaryServicesTypeName="fileSystem" fileSystemBlobStorageRootPath="C:\Blobs" />
</Sample>
(…)
</configuration>
Categories: Oracle Database, SQL Server, SQLAzure Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s