A comprehensive learning repository demonstrating Akka.NET patterns for IoT device management at scale (10 to 1000 devices).
| Pattern | Description | File |
|---|---|---|
| Actor Hierarchy | Manager → Group → Device supervision tree | Actors/ |
| Mailbox | FIFO message queue, priority mailbox, bounded mailbox | akka.hocon |
| Routing | RoundRobin, ConsistentHash, Broadcast pools | Routing/ |
| Event Sourcing | Akka.Persistence with SQL journal + snapshots | Persistence/ |
| Streams | Backpressure-aware telemetry pipelines | Streams/ |
| Pub/Sub | Kafka (persistent) + Redis (real-time) integration | PubSub/ |
| Cluster Sharding | Distribute device actors across nodes | Coordination/ |
| Cluster Singleton | Fleet-wide monitoring coordinator | Coordination/ |
- .NET 8 SDK
- (Optional) Docker for Kafka and Redis
# Clone and build
git clone <this-repo>
cd AkkaDotnetTutorial
dotnet build
# Run the demo
dotnet run --project src/AkkaDotnetTutorial.Host
# Run tests
dotnet testsrc/AkkaDotnetTutorial.Core/ ← All Akka.NET patterns (actors, routing, streams, etc.)
src/AkkaDotnetTutorial.Host/ ← Console app that wires everything together
tests/AkkaDotnetTutorial.Tests/ ← Unit tests with Akka.TestKit
docs/ ← Detailed docs with Mermaid sequence diagrams
Start with the Architecture Overview, then explore each pattern:
- Actor Hierarchy — supervision, registration, scatter-gather queries
- Routing Patterns — load distribution strategies
- Persistence & Event Sourcing — SQL journal, snapshots, recovery
- Pub/Sub with Kafka & Redis — cross-service messaging
- Akka Streams — backpressure pipelines for telemetry
- Cluster Sharding & Singleton — scaling across nodes
- Mailbox Deep Dive — message ordering, priority, types
- Device agnostic — works with any IoT protocol (MQTT, CoAP, HTTP, BLE)
- One actor per device — natural isolation, no shared mutable state
- Graceful degradation — Kafka/Redis unavailable? System continues locally
- Scale from laptop to cluster — same code, different configuration