World is now on Opti ID! Learn more

Per Magne Skuseth
Apr 1, 2014
  7558
(0 votes)

SQL Blob Provider: Store your blobs in the database

A new package is available on the EPiServer nuget feed: EPiCode.SqlBlobProvider. This is a blob provider that enables storing of blobs in the database, rather than on disk.

Why is this useful?

  • Perfect for load balanced environments, as you will not need a file share or similar to handle distribution of files between servers
  • Great for development teams who share a database
  • Easier to deploy: No need to copy blob files when doing a deploy or migration to another environment. No need of putting them in source control either for that matter
  • When you bring back the database from production to your development environment for that next feature you're doing, you get all the files too
  • Should also work fine for EPiServer Commerce

 

Installation

Install the NuGet package, and your are good to go. EPiServerFramework.config should be automatically transformed with the correct blob provider settings. If you need to change it manually, simply add the following to EPiServerFramework.config:

<blob defaultProvider="sqlBlobProvider">
  <providers>
    <add name="sqlBlobProvider" type="EPiCode.SqlBlobProvider.SqlBlobProvider, EPiCode.SqlBlobProvider" />
  </providers>
</blob>

Migration

If you are installing the SqlBlobProvider in an existing project that already uses the standard file blob provider, you will need to convert existing FileBlobs into SqlBlobs. This can easily be done with EPiCode.BlobConverter, which is another new package in the feed. The package contains a scheduled job (aka. BlobJob), which will convert all file blobs into the currently configured blob type. The conversion tool is not restricted to the SqlBlobProvider, so you could use it for other blob types as well.

Tip: If you are upgrading to EPiServer 7.5, and migrating VPP-based files to the new media system and want to use the SQL blob provider, make sure that the provider is installed prior before running the EPiServer VPP migration tool. This way, the VPP-files will be directly migrated to SQL blobs.

 

This is an open source module and full source code is available on EPiCode: 

https://www.coderesort.com/p/epicode/browser/EPiCode.SqlBlobProvider

Apr 01, 2014

Comments

Please login to comment.
Latest blogs
Make Global Assets Site- and Language-Aware at Indexing Time

I had a support case the other day with a question around search on global assets on a multisite. This is the result of that investigation. This co...

dada | Jun 26, 2025

The remote server returned an error: (400) Bad Request – when configuring Azure Storage for an older Optimizely CMS site

How to fix a strange issue that occurred when I moved editor-uploaded files for some old Optimizely CMS 11 solutions to Azure Storage.

Tomas Hensrud Gulla | Jun 26, 2025 |

Enable Opal AI for your Optimizely products

Learn how to enable Opal AI, and meet your infinite workforce.

Tomas Hensrud Gulla | Jun 25, 2025 |

Deploying to Optimizely Frontend Hosting: A Practical Guide

Optimizely Frontend Hosting is a cloud-based solution for deploying headless frontend applications - currently supporting only Next.js projects. It...

Szymon Uryga | Jun 25, 2025

World on Opti ID

We're excited to announce that world.optimizely.com is now integrated with Opti ID! What does this mean for you? New Users:  You can now log in wit...

Patrick Lam | Jun 22, 2025

Avoid Scandinavian Letters in File Names in Optimizely CMS

Discover how Scandinavian letters in file names can break media in Optimizely CMS—and learn a simple code fix to automatically sanitize uploads for...

Henning Sjørbotten | Jun 19, 2025 |