Dapr — Distributed Application Runtime for Cloud and Edge
Dapr is a portable, event-driven runtime that makes it easy for developers to build resilient, stateless and stateful microservices across cloud and edge environments.
What it is
Dapr (Distributed Application Runtime) is a portable, event-driven runtime that simplifies building resilient microservices. It provides building-block APIs for common distributed system patterns: service-to-service invocation, state management, publish/subscribe messaging, resource bindings, and observability.
Backend developers building microservice architectures who want to avoid implementing distributed system patterns from scratch will find Dapr useful. It runs as a sidecar process alongside your application and works with any language or framework.
How it saves time or tokens
Dapr abstracts infrastructure concerns behind stable HTTP/gRPC APIs. Instead of integrating directly with Redis, Kafka, or PostgreSQL for state and messaging, you call Dapr's API and configure the backend component separately. Switching from Redis to Cosmos DB requires a config change, not a code change.
How to use
- Install the Dapr CLI and initialize Dapr on your local machine or Kubernetes cluster.
- Define component configurations for the building blocks you need (state store, pub/sub broker, etc.).
- Call Dapr's HTTP or gRPC APIs from your application code to use state, messaging, and service invocation.
Example
# Install Dapr CLI
curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | bash
# Initialize Dapr locally
dapr init
# Run an app with Dapr sidecar
dapr run --app-id myapp --app-port 3000 -- node app.js
# Save state via Dapr HTTP API
import requests
DADR_URL = 'http://localhost:3500'
requests.post(
f'{DADR_URL}/v1.0/state/statestore',
json=[{'key': 'user-1', 'value': {'name': 'Alice', 'score': 42}}]
)
Related on TokRepo
- AI tools for DevOps — Other runtime and infrastructure tools for distributed systems.
- AI tools for self-hosted — Self-hosted platforms for running microservices.
Common pitfalls
- Running Dapr without understanding the sidecar pattern. Each application instance gets its own Dapr sidecar; this adds a process per instance.
- Choosing components without considering production requirements. The default in-memory state store loses data on restart; configure a durable backend before deploying.
- Ignoring Dapr's port configuration. The default sidecar port (3500) must not conflict with your application's ports.
Frequently Asked Questions
Dapr is language-agnostic. It runs as a sidecar and exposes HTTP and gRPC APIs. Any language that can make HTTP calls (Python, Go, Java, Node.js, C#, Rust, etc.) works with Dapr without a dedicated SDK.
Yes. Dapr has first-class Kubernetes support with its own operator and injector. Install it via Helm or the Dapr CLI. The sidecar is automatically injected into annotated pods.
Yes. Dapr is lightweight enough for edge environments. It runs on ARM devices and can use local components (SQLite for state, in-memory pub/sub) when cloud services are unavailable.
Service meshes handle network concerns (mTLS, traffic routing, observability). Dapr provides application-level building blocks (state, pub/sub, bindings). They are complementary: you can run Dapr alongside Istio.
Yes. Dapr is a Cloud Native Computing Foundation (CNCF) graduated project, which indicates maturity and broad community adoption.
Citations (3)
- Dapr GitHub— Dapr is a CNCF graduated project
- Dapr Docs— Dapr building blocks documentation
- Microsoft Architecture Docs— Sidecar pattern in distributed systems
Related on TokRepo
Discussion
Related Assets
Moodle — Open-Source Learning Management System
The most widely used open-source learning platform, providing course management, assessments, and collaboration tools for educators and organizations worldwide.
Sylius — Headless E-Commerce Framework on Symfony
An open-source headless e-commerce platform built on Symfony and API Platform, designed for developers who need a customizable and API-first commerce solution.
Akaunting — Free Self-Hosted Accounting Software
A free, open-source online accounting application built on Laravel for small businesses and freelancers to manage invoices, expenses, and financial reports.