Dapr (Distributed Application Runtime) hit v1.0 recently. Having deployed it in production on Kubernetes, I can say it lives up to the hype. It separates the Application Logic from the Infrastructure Plumbing via the sidecar pattern.
The Sidecar Architecture
flowchart LR
App["Your App (.NET/Node)"] -- HTTP POST --> Sidecar["Dapr Sidecar"]
Sidecar -- gRPC --> Component["State Store (Redis)"]
style Sidecar fill:#FFF3E0,stroke:#E65100,stroke-width:2px
style App fill:#E1F5FE,stroke:#0277BD
Your code looks like this:
await client.SaveStateAsync("statestore", "key", "value");
You don’t reference Redis SDK. You don’t reference Cosmos DB SDK. You reference Dapr. This means you can swap Redis for Cosmos DB by changing a YAML file, with zero code changes.
Discover more from C4: Container, Code, Cloud & Context
Subscribe to get the latest posts sent to your email.