---
title: BLOB storage and providers
slug: cms-13/docs/blob-storage-and-providers
docTags: 
createdAt: 2026-07-30T20:22:09.640Z
---

BLOB providers store large amounts of binary data in an optimized, cost-effective solution such as cloud storage instead of a database. Use BLOB providers to offload media and file storage from the database, improving performance and scalability.

## BLOB providers

Optimizely supports BLOB storage of assets using a provider-based setup and includes a built-in file BLOB provider. The following options are available:

- **Customized BLOB provider** – Create a provider for your specific hosting environment. BLOB providers for Microsoft Azure and Amazon Web Services are available from the [Optimizely NuGet feed](http://nuget.optimizely.com).
- **Built-in BLOB provider** – Optimizely includes an implementation for [Microsoft Azure](https://nuget.optimizely.com/packages/episerver.azure/13.0.0). An open-source example for [Amazon](https://github.com/episerver/content-amazon) is also available. This example is not actively maintained or updated to CMS 13 but serves as inspiration for an implementation on Amazon or another storage backend.

## BLOB architecture

Understanding BLOB architecture helps you work with containers, unique identifiers, and the provider API effectively.

A provider stores and associates a data stream with a unique identifier. BLOBs are grouped into containers: a logical name for a set of BLOBs that you delete with a single API call. The unique identifier is exposed as a URI in the format `epi.fx.blob://[provider]/[container]/[blob]` to store a reference to a BLOB in a database.

Most API methods return a reference even when the actual BLOB does not exist because accessing a cloud service on every call is too costly. For example, `GetBlob` returns a reference, and the caller tracks BLOB identifiers.

The following example shows how to use a BLOB provider.

```csharp
public void ReadWriteBlobs() {
  var blobFactory = ServiceLocator.Current.GetInstance<IBlobFactory>();

  //Define a container
  var container = Blob.GetContainerIdentifier(Guid.NewGuid());

  //Uploading a file to a blob
  var blob1 = blobFactory.CreateBlob(container, ".png");
  using(var fs = new FileStream("c:\\myfile.png", FileMode.Open)) {
    blob1.Write(fs);
  }

  //Writing custom data to a blob
  var blob2 = blobFactory.CreateBlob(container, ".txt");
  using(var s = blob2.OpenWrite()) {
    var w = new StreamWriter(s);
    w.WriteLine("Hello World!");
    w.Flush();
  }

  //Reading from a blob based on ID
  var blobID = blob2.ID;
  var blob3 = blobFactory.GetBlob(blobID);
  using(var s = blob3.OpenRead()) {
    var helloWorld = new StreamReader(s).ReadToEnd();
  }

  //Delete single blob
  blobFactory.Delete(blobID);

  //Delete container
  blobFactory.Delete(container);
}
```

:::hint{type="info"}
**Note**
Deleting a container under the website root with the `FileBlob` provider leaves empty folders under the website root. The Azure and Amazon providers delete the containers. For information about handling media in the assets pane, see [Media examples](docId\:ynO9FZriZuWJoM0pBnxgl).
:::
