// AKKA.PERSISTENCE
Akka.Persistence makes actor state re-entrant — park it when idle, recover it automatically when needed. Because it's event sourced, your state is immutable and replayable, making CQRS a natural fit.
// IN_CODE
Persist events, update your state, sync your read model, and execute side effects — all in one pipeline. The async onComplete callback runs after all events are persisted. Read the full case study →
public class SubscriptionActor : ReceivePersistentActor { private SubscriptionState _state = SubscriptionState.Empty; public override string PersistenceId { get; } public SubscriptionActor(string subscriptionId) { PersistenceId = $"subscription-{subscriptionId}"; // Handle commands — process, persist, react Command<UpgradeSubscription>(cmd => { var events = _state.ProcessUpgrade(cmd); PersistAll(events, evt => _state = _state.Apply(evt), onComplete: async () => { await SyncReadModel(); // sync EF Core projection await SendConfirmation(); // email, notifications Sender.Tell(new UpgradeComplete()); }); }); // Recover state on startup — replay events from journal Recover<ISubscriptionEvent>(evt => _state = _state.Apply(evt)); Recover<SnapshotOffer>(snap => _state = (SubscriptionState)snap.Snapshot); } }
// KEY_CAPABILITIES
Don't keep every actor in memory. Persistence lets you park actor state and recover it on demand — database-agnostic, scaling to millions of actors. Perfect for intermittent workloads like user sessions or IoT devices.
Immutable event logs make it easy to create projections and implement Command Query Responsibility Segregation. We have code samples and guides to get you started.
Akka.NET v1.5 introduced token bucket throttling for Persistence.Query, enabling 100k+ concurrent queries against SQL Server with zero errors.
Plug in any supported database. Akka.Persistence.Sql (Linq2Db-based) provides cross-database support, or use dedicated providers for specialized needs.
// SUPPORTED_DATABASES
+ community packages for Oracle, RavenDB, DynamoDB, RocksDB, Google Bigtable, LiteDB
// WHO_USES_THIS
NRK (Norwegian Broadcasting Corporation)
Broadcasting / Media — Norway
NRK built a media distribution engine using Akka.NET and F# that has been in production since 2016 — one of the longest-running Akka.NET deployments in the community. They use Persistence with Cluster Sharding for durable media set state, and evolved from RabbitMQ-based delivery to a cleaner "desired state" persistence pattern.
Game Plumbers
Gaming / Unity
Game Plumbing Framework uses Akka.NET persistence to enable Unity game developers to create full-stack multiplayer games. The Akka.NET backend delivers ~5ms per message compared to 40ms+ on AWS Serverless, with negligible additional time for inter-actor hops.