Cratis.Orleans.Storage 1.27.2

Prefix Reserved
dotnet add package Cratis.Orleans.Storage --version 1.27.2
                    
NuGet\Install-Package Cratis.Orleans.Storage -Version 1.27.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cratis.Orleans.Storage" Version="1.27.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cratis.Orleans.Storage" Version="1.27.2" />
                    
Directory.Packages.props
<PackageReference Include="Cratis.Orleans.Storage" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cratis.Orleans.Storage --version 1.27.2
                    
#r "nuget: Cratis.Orleans.Storage, 1.27.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cratis.Orleans.Storage@1.27.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cratis.Orleans.Storage&version=1.27.2
                    
Install as a Cake Addin
#tool nuget:?package=Cratis.Orleans.Storage&version=1.27.2
                    
Install as a Cake Tool

<div align="center"> <a href="https://www.cratis.io"> <img src="full-logo.png" alt="Cratis Orleans" width="480"> </a>

<h3 align="center">Cratis Orleans</h3>

<p align="center"> Cratis Orleans is a set of building blocks for .NET developers that provides durable jobs, pluggable jobs storage, and silo hosting. <br /> <a href="https://www.cratis.io/orleans/"><strong>Explore the docs »</strong></a> <br /> <br /> <a href="#-getting-started">Getting Started</a>  ·  <a href="https://github.com/cratis/Orleans/issues/new?labels=bug">Report a Bug</a>  ·  <a href="https://github.com/cratis/Orleans/issues/new?labels=enhancement">Request a Feature</a>  ·  <a href="https://discord.gg/kt4AMpV8WV">Join the Discord</a> </p>

<p align="center"> <a href="https://discord.gg/kt4AMpV8WV"> <img src="https://img.shields.io/discord/1182595891576717413?label=Discord&logo=discord&color=7289da" alt="Discord"> </a> <a href="http://nuget.org/packages/cratis.orleans"> <img src="https://img.shields.io/nuget/v/Cratis.Orleans?logo=nuget" alt="NuGet"> </a> <a href="https://github.com/Cratis/Orleans/actions/workflows/dotnet-build.yml"> <img src="https://github.com/Cratis/Orleans/actions/workflows/dotnet-build.yml/badge.svg" alt=".NET Build"> </a> <a href="https://github.com/Cratis/Orleans/actions/workflows/publish.yml"> <img src="https://github.com/Cratis/Orleans/actions/workflows/publish.yml/badge.svg" alt="Publish"> </a> <a href="./LICENSE"> <img src="https://img.shields.io/badge/license-MIT-blue" alt="License"> </a> </p> </div>


Cratis Orleans holds the Orleans building blocks every Cratis service needs: a durable job system for work that outlives a request, a storage API the job state persists through — with MongoDB, SQL and in-memory providers — and the silo hosting tooling that co-hosts Orleans next to an application in one call.

It is consolidated here from Chronicle (the job engine, the workers pattern, the serializers), Direct (the hosting knowledge) and Studio (the package-alignment guard) — so all three consume one canonical implementation instead of three diverging copies. The repository has no dependency on Chronicle; Chronicle is a consumer, like every other Cratis service.

For core values and principles, read our core values and principles.

✨ Key Features

⚙️ Job System

Durable Jobs Work that outlives a request — replay, migration, provisioning — persisted through the storage API and rehydrated when the silo restarts
Steps as Grains Each step is its own Orleans grain, so slow or hanging steps never stall each other and run in parallel, bounded by a throttle
Plan then Perform PrepareSteps says what will happen before any of it happens — watchable progress rather than a spinner
At-least-once A step in flight when the host went down is performed again on resume; progress checkpoints are debounced and time-flushed
Fail-open One failed step fails the job's completion status — never the application; the history says which step was which
Lifecycle Control Stop, resume and delete through the jobs manager grain, or the client-facing commands consumers build on it

🗄️ Pluggable Storage

Scope + Namespace Seam IJobsStorage.GetFor(scope, namespace) — opaque values every consumer maps its identity onto (Chronicle: event store and namespace; an application: tenant or service)
MongoDB Provider Polymorphic request BSON serialization, indexes on status and type, conventions, configurable database naming
SQL Provider EF Core — SQL Server, PostgreSQL, SQLite — with full provider and connection flexibility per scope
In-memory Provider For spec hosts and services that do not need jobs to survive a restart

🖥️ Silo Hosting

One Call AddCratisOrleans brings the whole job system: grains, storage providers, serializers, type discovery, throttle and options
Clustering Localhost for development, durable MongoDB membership for running more than one instance
Reminder Safety The 9.x MongoDB provider's reminder table hangs the 10.x reminder service — the hosting keeps reminders on the in-memory service and the knowledge lives here once
Alignment Guard Cratis.Orleans depends directly on Orleans 10 Reminders for .NET 8, 9 and 10, so the MongoDB provider's Orleans 9 dependency cannot split a consumer's graph. The buildTransitive target also fails Release builds if Reminders drifts from Server.

🔧 Building Blocks

Workers The background-task pattern the job steps run through — also usable directly
Typed Grain Keys KeyHelper combines and parses compound grain keys (scope#namespace)
Cratis Serializers Orleans codecs for concepts (ConceptAs<T>), OneOf, expando objects and LINQ collections, plus a JSON fallback carrying the job state converter
Public Logging Surface BeginJobScope/BeginJobStepScope and the [LoggerMessage] partials a consumer's own jobs read through

📦 Packages

Package What it holds
Cratis.Orleans The job engine, Workers, typed grain keys, serializers, silo hosting
Cratis.Orleans.Storage The jobs storage API, the scope resolver, the in-memory provider
Cratis.Orleans.Storage.MongoDB The MongoDB storage provider
Cratis.Orleans.Storage.Sql The SQL storage provider (EF Core; net10, matching EF Core 10)

🚀 Getting Started

You need the .NET 10 SDK and, for anything but the in-memory storage, a MongoDB server.

dotnet add package Cratis.Orleans
dotnet add package Cratis.Orleans.Storage.MongoDB
using Cratis.Orleans.Hosting;
using Cratis.Orleans.Setup;
using MongoDB.Driver;

var builder = WebApplication.CreateBuilder(args);

builder.AddCratisOrleans(new CratisOrleansOptions
{
    ClusterId = "my-service",
    ServiceId = "my-service"
});

builder.Services.AddCratisOrleansMongoDBJobsStorage(
    new MongoClient("mongodb://localhost:27017"));

var app = builder.Build();
app.Run();

Define a job and its steps — grains, discovered automatically, nothing to register:

public record ProvisionTenant(string TenantId, string[] Features) : IJobRequest;

public interface IProvisionTenant : IJob<ProvisionTenant>;

public class ProvisionTenantJob : Job<ProvisionTenant, JobState>, IProvisionTenant
{
    // Completed jobs remove themselves by default; keep this one queryable.
    protected override bool KeepAfterCompleted => true;

    protected override Task<IImmutableList<JobStepDetails>> PrepareSteps(ProvisionTenant request) =>
        Task.FromResult<IImmutableList<JobStepDetails>>(
            request.Features.Select(feature => new JobStepDetails(
                Type: typeof(IProvisionFeatureStep),
                Id: JobStepId.New(),
                Key: new JobStepKey(JobId, string.Empty, string.Empty),
                Request: feature,
                ResultType: typeof(string))).ToImmutableList());
}

Start it through the jobs manager — the two strings are the storage scope and namespace:

var manager = grainFactory.GetJobsManager("my-service", string.Empty);
var result = await manager.Start<IProvisionTenant, ProvisionTenant>(new(id, ["billing"]));

Starting returns as soon as the job exists. Stop the service mid-flight and start it again — the job picks itself back up. That is the point.

Read the full walkthrough in the getting-started guide.

🧪 Testing

The repository carries three spec tiers:

  • Unit specs (Source/*/.Specs) — 76+ Orleans TestKit specs covering the job grain lifecycle, the throttle, the checkpoint debouncer, the serializers and the storage scope resolution.
  • Integration specs (Integration/Jobs.Integration) — end-to-end against a real co-hosted silo and a real MongoDB: start a job, run its steps as real grains, persist the state. CI runs a MongoDB service container so these gate every pull request.
  • Consumer suites — Chronicle's kernel spec suite (3,496 specs) runs against the package engine through its rip-out integration.

🤝 Support

Cratis is an open community, and we are glad to help users, teams evaluating the stack, and contributors.

Channel Details
Discord Join the community on Discord for questions and discussions
GitHub Issues Report bugs or request features
Documentation Read the docs at cratis.io/orleans

👷 Contributing

If you want to jump into building this repository and possibly contributing, refer to contributing.

Prerequisites

  • .NET 10 SDK
  • Docker — the integration specs and the MongoDB spec suites run against containers

Build and test

dotnet build
dotnet test

The integration specs expect a MongoDB on localhost:27017 (or a running Docker daemon).

📄 License

Cratis Orleans is free software distributed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Cratis.Orleans.Storage:

Package Downloads
Cratis.Chronicle.Testing

Testing helpers for Cratis Chronicle - the open-source (MIT) event-sourcing database and runtime. In-process kernel and in-memory storage for testing event-sourced applications.

Cratis.Chronicle.XUnit.Integration

xUnit integration-testing support for Cratis Chronicle - the open-source (MIT) event-sourcing database and runtime. Fixtures and helpers for integration tests against an in-process kernel.

Cratis.Orleans

Shared Orleans building blocks for the Cratis platform - job system, workers, typed grain keys, serializers and silo hosting tooling

Cratis.Orleans.Storage.MongoDB

MongoDB storage provider for the Cratis.Orleans job system

Cratis.Orleans.Storage.Sql

SQL storage provider (EF Core: SQL Server, PostgreSQL, SQLite) for the Cratis.Orleans job system

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.27.2 0 10/20/2026
1.27.1 85 10/19/2026
1.27.0 65 10/19/2026
1.26.0 54 10/19/2026
1.25.0 1,345 10/18/2026
1.24.3 66 10/18/2026
1.24.2 418 10/18/2026
1.24.1 64 10/18/2026
1.24.0 70 10/18/2026
1.23.5 131 10/18/2026
1.23.4 2,812 10/18/2026
1.23.3 69 10/17/2026
1.23.2 71 10/17/2026
1.23.1 69 10/17/2026
1.23.0 3,575 10/17/2026
1.22.3 63 10/17/2026
1.22.2 79 10/17/2026
1.22.1 65 10/17/2026
1.22.0 69 10/17/2026
1.21.0 71 10/17/2026
Loading failed