Table of Contents

Going durable

This page is part of the documentation for Orleans.Lattice 10.5.0 (release line 10.5), built 2026-12-05. It is also published as markdown, with every table and list, at going-durable.md, and llms.txt lists every page.

Durable grain storage and a durable write-ahead log, in place of the in-memory defaults.

, English captions, Download the MP4 (7.2 MB)

Transcript

Going durable

TTL and soft delete showed how data goes away when you ask it to. Here, we stop it going away when a silo restarts.

This is Going durable: durable grain storage and a durable write-ahead log, in place of the in-memory defaults.

Two halves, both in memory

Every episode so far has run on the defaults, and the defaults keep everything in memory.

A tree lives in two places. Grain storage holds its leaves and their snapshots, and the write-ahead log holds every committed write, in order. In memory, neither survives a restart, so going durable means replacing both.

Durable grain storage

Start with grain storage. The callback you pass when you register Lattice chooses it, so swap the memory provider for a durable Orleans provider, here Azure Table storage.

That provider must enforce ETags, so that a write presenting a stale one fails. Orleans' own durable providers do, and each silo checks as it starts: by default, a provider that accepts a stale write stops the silo from starting.

A durable log on disk

Then the write-ahead log. With no cloud dependency, the file provider keeps it on local disk: one call, and a root directory.

It suits a single container with a mounted volume. Each batch is all or nothing, so a crash before a batch is committed rolls it back.

Or in Azure Table storage

For production deployments replicated across regions, the Azure Table provider keeps the log in a storage table instead. Either call replaces the in-memory log, whether it comes before or after Lattice is registered.

Either way, the log is only half of a durable tree. It is trimmed once a snapshot in grain storage covers it, so pair it with durable grain storage too, not the memory provider.

Where next

Next on Build: Moving in from another store. The links are on this episode's page in the documentation.

The code on screen

The episode starts from the in-memory defaults, registers Azure Table grain storage through AddLattice, then registers a durable write-ahead log on local disk or in Azure Table storage. The snippets are compiled with the rest of the documentation.

siloBuilder.AddLattice((silo, name) => silo.AddMemoryGrainStorage(name));
using Azure.Data.Tables;
using Microsoft.Extensions.DependencyInjection;

var connectionString = "UseDevelopmentStorage=true";
siloBuilder.AddLattice((services, storageName) =>
{
    services.AddAzureTableGrainStorage(storageName, options =>
        options.TableServiceClient = new TableServiceClient(connectionString));
});
using Orleans.Lattice.Storage.File;

siloBuilder.AddFileWalStorage(options =>
{
    options.RootDirectory = "/data/wal";
});
using Orleans.Lattice.Storage.AzureTable;

siloBuilder.AddAzureTableWalStorage(options =>
{
    options.ConnectionString = "UseDevelopmentStorage=true";
});

Where next