Dapr Logo
Adopt Platform CNCF Graduated App Definition and Development / Application Definition & Image Build

Dapr

License: Apache-2.0

CNCF Project

Cloud Native Computing Foundation

Accepted: 2021-11-09
Incubating: 2021-11-09
Graduated: 2024-10-30

Community

Join the conversation

Complete Guide

Comprehensive documentation, best practices, and getting started tutorials

Dapr (Distributed Application Runtime) is a portable, event-driven runtime that makes it easy for developers to build resilient, microservice stateless and stateful applications that run on the cloud and edge. Dapr codifies the best practices for building microservice applications into open, reusable building blocks that can be used regardless of the programming language, framework, or platform being used.

Dapr offers a consistent and simplified developer experience. It provides building blocks like service invocation, state management, pub/sub, bindings, actors, and observability, enabling developers to focus on business logic rather than infrastructure concerns. Use cases include building microservices architectures, event-driven applications, IoT applications, and distributed systems where resilience, scalability, and portability are crucial.

Dapr (Distributed Application Runtime) provides a set of portable, event-driven building blocks that make it easy for developers to build resilient, microservice-based applications, abstracting away the complexities of distributed systems.

Architecture: The Sidecar Pattern

Dapr works by running as a sidecar alongside your application. This sidecar communicates with your application via standard HTTP or gRPC, meaning Dapr is language-agnostic. Your application doesn’t need to import any Dapr SDKs or libraries directly, allowing it to run anywhere Dapr can run.

Key Building Blocks

Dapr offers a variety of “building blocks” that encapsulate common distributed systems patterns:

  • Service Invocation: Enables reliable and secure communication between services, with built-in retries and tracing.
  • State Management: Provides a consistent API for storing and retrieving state, backed by various state stores (e.g., Redis, CosmosDB, PostgreSQL).
  • Publish & Subscribe: Facilitates asynchronous messaging between services using a standardized API over different message brokers (e.g., Kafka, RabbitMQ, Azure Service Bus).
  • Resource Bindings: Connects your application to external systems (databases, queues, IoT devices) using input and output bindings.
  • Actors: Provides a framework for building stateful, single-threaded objects (virtual actors) for high-concurrency scenarios.
  • Observability: Automatically emits metrics, traces, and logs for all Dapr operations, integrating with popular monitoring tools.
  • Secrets Management: Securely accesses application secrets from various secret stores.

Benefits

  • Developer Productivity: Developers can focus on business logic rather than reimplementing distributed systems patterns.
  • Language Agnostic: Works with any programming language or framework.
  • Portability: Deploy your Dapr applications on Kubernetes, virtual machines, or edge devices.
  • Resilience & Scalability: Built-in features for retries, circuit breakers, and scaling.
  • Security: Features like mTLS between Dapr sidecars enhance communication security.