Akka.NET The Future of Distributed Programming in .NET Aaron Stannard, Co-founder Akka.NET @Aaronontheweb
High Expectations for Backend Developers
And the obvious ways to scale are wrong.
Enterprise CRUD App
Scenario 1: Surge in User Activity
Obvious Solution: Sharding
Brittle
Scenario 2: Real-time User Interactivity
Obvious Solution: Read-after-Write
Reality
Why is Distributed Programming Hard?
Enter the Actor Model
Actor Model Core Concepts
Actor Model for .NET
Akka.NET Modules Akka – core actor library Akka.Remote – cross-node actor deployment / communication Akka.Cluster – elastic actor networks (HA) Akka.Persistence – event-sourcing, durable actor state & recovery Akka.Streams – streaming workflows Akka.Cluster.Tools – cluster singleton, distributed pub sub Akka.Cluster.Sharding – durable state partitioning Akka.DData – eventually consistent data replication
What's an Actor?
Actors live in a family tree
Actors process one message at a time
Properties of Messages
Messaging Patterns
Messaging Protocols
Communicate with Actors via Reference
Actor References Have Transparent Locations
Akka.Remote & Akka.Cluster: Location Doesn't Matter
Benefits of Clustering
Elastic (Join)
Elastic (Leave)
No Configuration Changes
Recover from Failures
Decentralized
Fastest Response Time?
Stateful Apps Serve Results from Memory
State Locality
State Makes Protocols Work
CAP Theorem
CAP Terminologies
CAP & Protocols
Clustering is for AP (by default)
Fault and Resource Isolation with Actors
Actor Lifecycle Phases
"Just let it crash"
DeathWatch: Subscribe to Actors' Lifecycle
Petabridge