Dapr Distributed Application Stack
A polyglot microservices stack using Dapr sidecars to provide portable building blocks, service invocation, state, pub/sub, and bindings, decoupled from infrastructure, backed by Redis and Kafka on Kubernetes.
The Dapr Distributed Application Stack uses Dapr, the Distributed Application Runtime, to provide common microservice capabilities as pluggable building blocks. Dapr runs as a sidecar next to each service, offering service invocation, state management, pub/sub, and bindings over a consistent API, backed by components like Redis and Kafka, typically on Kubernetes. It lets polyglot teams build distributed apps without coupling code to specific infrastructure.
Components
Dapr runs as a sidecar process or container alongside each application, exposing HTTP and gRPC APIs for a set of building blocks: service-to-service invocation with retries and mTLS, state management, publish/subscribe messaging, resource bindings, secrets, and actors. Each building block is backed by a swappable component: for example, Redis or another store for state, and Kafka, Redis, or a cloud broker for pub/sub. Kubernetes hosts the services and their sidecars, and Docker packages the applications. The application calls Dapr's API rather than a specific database or broker SDK.
Strengths
Dapr decouples application code from infrastructure: switching the state store or message broker is a configuration change, not a code rewrite, which improves portability across environments and clouds. The sidecar model is language-agnostic, so polyglot teams use the same building blocks consistently. Common distributed-systems concerns, retries, mTLS, pub/sub, state, and the actor model, are handled by the runtime, reducing boilerplate and bespoke code. It works both on Kubernetes and self-hosted. The consistent API simplifies onboarding and standardizes patterns across services.
Trade-offs
The sidecar adds a process and some latency and resource overhead per service. Dapr is another platform component to learn, deploy, and operate, with its own concepts and configuration. The abstraction can hide details of the underlying store or broker, occasionally complicating tuning and debugging. While it supports many components, advanced provider-specific features may not be exposed through the generic API. For simple systems or single-language teams already comfortable with direct SDKs, Dapr may add more than it saves.
Components and Operations
Dapr's building blocks cover the recurring needs of distributed systems through a single, consistent API. Service invocation adds automatic retries, mutual TLS, and tracing to direct calls. State management offers key-value storage with optional concurrency and consistency guarantees over stores like Redis. Publish/subscribe abstracts brokers such as Kafka, NATS, or cloud services so producers and consumers exchange CloudEvents without broker-specific code. Bindings connect to external systems for input and output, secrets integrate with vaults, and the actor model supports stateful, single-threaded units of concurrency. Components are declared as Kubernetes resources, making the backing infrastructure swappable per environment. Operationally, Dapr injects sidecars automatically on Kubernetes, exposes metrics to Prometheus, and emits distributed traces via OpenTelemetry, so calls across services and building blocks are observable. Because the same API works whether running locally or in production, developer and production environments stay consistent, easing testing and onboarding.
When to Use It
Choose this stack for polyglot microservices that value portability and a consistent set of distributed-systems building blocks across services and environments, especially when you want to avoid hard-coding infrastructure choices. It suits teams building event-driven and stateful services who benefit from standardized patterns. For small, single-language systems or when you need deep, provider-specific control, using native SDKs directly may be simpler.