ScriptsApr 15, 2026·3 min read

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.

TL;DR
Dapr provides building-block APIs for microservices: service invocation, state, pub/sub, and bindings.
§01

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.

§02

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.

§03

How to use

  1. Install the Dapr CLI and initialize Dapr on your local machine or Kubernetes cluster.
  2. Define component configurations for the building blocks you need (state store, pub/sub broker, etc.).
  3. Call Dapr's HTTP or gRPC APIs from your application code to use state, messaging, and service invocation.
§04

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}}]
)
§05

Related on TokRepo

§06

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

What programming languages does Dapr support?+

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.

Does Dapr run on Kubernetes?+

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.

Is Dapr suitable for edge deployments?+

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.

How does Dapr compare to service meshes like Istio?+

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.

Is Dapr a CNCF project?+

Yes. Dapr is a Cloud Native Computing Foundation (CNCF) graduated project, which indicates maturity and broad community adoption.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets