Skip to content
Microsoft Orleans

Microsoft Orleans

Distributed systems, simplified.

Build scalable, resilient applications using virtual actors and the familiar tools and patterns of .NET.

Distributed systems, without distributed complexity

Section titled “Distributed systems, without distributed complexity”

Virtual actors

Model your application as grains with stable identities, behavior, and state. Orleans activates and locates them on demand.

Automatic lifecycle

Let the runtime place, activate, deactivate, and recover grains while your code focuses on business behavior.

Elastic by design

Scale from one process to a resilient cluster without changing the programming model or managing actor placement.

Built for .NET

Use interfaces, dependency injection, async/await, generic hosting, and the libraries your team already knows.

Define a grain contract, implement it as an ordinary .NET class, and call it from anywhere in the cluster.

Define a grain

Counter.cs
public interface ICounter : IGrainWithStringKey
{
Task<int> Add(int value);
}
public sealed class Counter : Grain, ICounter
{
private int _value;
public Task<int> Add(int value) =>
Task.FromResult(_value += value);
}

Call it from a client or another grain

Program.cs
var counter = client.GetGrain<ICounter>("orders");
var total = await counter.Add(1);