Skip to content

Orleans

A .NET framework for building distributed apps using 'grains', objects that stay available across many servers

Stars
10.9k
Forks
2.2k
Licence
MIT
Language
C#
Last update
4 days ago
Type
Library

What it is

Orleans is a framework for building distributed applications in C#, the kind that run across several servers or in the cloud. It extends familiar .NET ideas like objects, interfaces, and async/await to multi-server setups. Its core unit, the grain, is an object with a stable identity that the runtime can activate, move, and deactivate as needed, so developers can write code as if all grains were always in memory.

  • Modeling each IoT device as a grain that keeps its latest data in memory, as the README's thermostat example shows
  • Building a Web backend where frontends call grains through strongly-typed interfaces
  • Persisting grain state to a storage system of your choice with state.WriteStateAsync()
  • Coordinating changes across multiple grains using distributed transactions

Great for

  • C# and .NET developers building scalable backend services
  • Teams modeling many independent entities, such as devices or users, as stateful objects
  • Developers moving from single-server apps to distributed systems
  • Projects that need persistence or distributed transactions across grains

Not ideal for

  • Developers who work in languages other than C#/.NET, since the framework is built for .NET (the README does not describe other language bindings)
  • Small single-server apps with no scaling needs, where the added concepts may not pay off
  • Teams that need to understand every low-level detail of their cluster, since the runtime manages placement and recovery for you
Step-by-step guide: how to use OrleansInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: .NET (version not specified in the README excerpt)

    Clone the repository

    git clone https://github.com/dotnet/orleans
  2. 2

    Run it

    • Install .NET and create a project
    • Add the Orleans NuGet packages (Microsoft.Orleans.Core is named in the README badge)
    • Define a grain interface that extends IGrainWithStringKey and a class that implements it
    • Call the grain from a client using client.GetGrain<T>(id)
    • Read the Orleans docs for the sample projects and the full setup
  3. 3

    Get the most out of it

    • Use grain persistence to store state in any storage system you choose
    • Use reminders (persistent timers) for work that must survive restarts
    • Use streams to observe time-series data, as in the README's IoT example
    • Use distributed ACID transactions when several grains must change together

Downloads

Strengths

  • Stable grain identities let callers reach an object without knowing which server hosts it
  • Grain state is kept in memory while active, which the README says lowers latency and load on data stores
  • Works from a single on-premises server up to a multi-server cluster

Trade-offs

  • The programming model is unfamiliar at first, and the README is a high-level overview rather than a tutorial
  • The README's examples omit persistence, so state handling requires reading the separate docs
  • Cluster behavior and operations are not covered in this excerpt, so production setup needs more research

How it compares

ProjectStarsTypeLevelUpdatedBest for
orleans (this)10.9kLibraryintermediate4 days agoC# and .NET developers building scalable backend services
go-zero33.4kLibraryintermediate5 days agoGo developers building REST APIs or microservices
kratos26kLibraryintermediate4 days agoGo developers building a set of backend services that talk over HTTP or gRPC
effect17.5kLibraryadvanced4 days agoTeams building large or long-lived TypeScript back-end services
BenchmarkDotNet11.5kLibraryintermediate5 days ago.NET developers who want to compare two or more implementations of a method
conc10.4kLibraryintermediate2 months agoGo developers who use goroutines in long-running services

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.