Dapr (Distributed Application Runtime), launched by Microsoft in 2019, reached v1.0 in February 2021. The project provides building blocks for common distributed application patterns as a sidecar, abstracting cloud provider differences.

The sidecar model

Dapr runs as a sidecar process alongside each application service. The application communicates with Dapr via HTTP or gRPC on localhost. Dapr handles the distributed system complexity: service invocation with retries and circuit breaking, pub/sub messaging with at-least-once delivery, state management with pluggable backends, secrets management, and distributed tracing. The application code stays clean of cross-cutting distributed systems concerns.

Portability through component abstractions

Dapr components abstract the underlying infrastructure. The pub/sub component works with Azure Service Bus, AWS SNS/SQS, Kafka, or Redis, the application code uses the Dapr pub/sub API and the component configuration determines the actual message bus. Swapping from Redis pub/sub in development to Azure Service Bus in production is a configuration change, not a code change.

Service invocation with name resolution

Dapr service invocation allows one service to call another by name rather than by host:port. The Dapr sidecar handles name resolution (via DNS, mDNS, or a custom resolver), load balancing, and mTLS. In Kubernetes, service invocation integrates with the Kubernetes service registry. The result is service-to-service calls that look like localhost calls from the application's perspective but get distributed system resilience from Dapr.

State management building block

Dapr's state management API provides a key-value store abstraction backed by any supported state store (Redis, Azure Cosmos DB, DynamoDB, PostgreSQL, and others). The API supports concurrency control (optimistic concurrency with ETags) and consistency options. For stateless microservices that need to store minimal session or workflow state, Dapr state management provides a consistent API regardless of the underlying store.