Dapr, which stands for Distributed Application Runtime, is an open-source, portable, event-driven runtime that simplifies the development of microservices and distributed applications. It provides a set of building blocks and abstractions to address common challenges in building distributed systems, such as state management, service-to-service invocation, and event-driven communication.
Here are some key features and components of Dapr:
Service Invocation: Dapr simplifies the communication between microservices. It abstracts away the details of network communication and provides a consistent API for services to call each other, regardless of the underlying communication mechanism.
State Management: Dapr provides a key/value store abstraction for managing state. This allows microservices to easily store and retrieve state without worrying about the specific storage implementation. Dapr supports various state stores, including Redis, Azure Cosmos DB, and others.
Publish-Subscribe Messaging: Dapr facilitates event-driven communication between microservices using a publish-subscribe model. Microservices can publish events to topics, and other microservices can subscribe to these topics to receive relevant events.
Bindings: Dapr introduces the concept of bindings, which are connectors to external resources such as databases, message queues, or other services. This allows developers to interact with these resources in a standardized way without being tightly coupled to the specific implementation.
Secrets Management: Dapr helps manage secrets and sensitive information securely. It enables developers to easily access secrets without embedding them directly in their code.
Observability: Dapr includes observability features, making it easier to monitor and trace the behavior of microservices. It integrates with popular observability tools like Prometheus and Zipkin.
Actor Model: Dapr implements the actor model, providing a way to build stateful and stateless actors. Actors are isolated units of computation that can interact with each other through messages.
For app developers, Dapr offers several benefits:
Abstraction of Complexity: Developers can focus on building business logic without worrying about the intricacies of distributed systems. Dapr abstracts away common challenges, providing a more straightforward development experience.
Polyglot Support: Dapr is language-agnostic, meaning developers can use their preferred programming languages to build microservices. It provides SDKs for various programming languages.
Interoperability: Dapr is designed to be portable and can run on various platforms. This allows developers to build interoperable microservices that can run in different environments.
Easier Debugging and Testing: Dapr's modular design makes it easier to test and debug individual components of a distributed application in isolation.
To use Dapr, developers need to integrate the Dapr sidecar with their microservices. The sidecar runs alongside the application, providing the necessary runtime and services. Developers interact with Dapr through its APIs or SDKs in their preferred programming language. Dapr can be deployed in various environments, including Kubernetes, local development, and other cloud platforms.
These are the v1.12 release highlights:
APIs
Service Invocation: HTTP streaming stable and enabled by default
The HTTP service invocation API now leverages streaming by default and is stable in the v1.12 release. This increases the overall performance of HTTP service invocation in many scenarios. Users that leverage HTTP service invocation will notice improvements such as: reduced memory usage, much smaller time-to-first-byte (TTFB), and can now send messages in chunks.
Service Invocation: TLS for non-Dapr endpoints
You can now securely call https://
non-Dapr endpoints providing a certificate for authentication to the remote endpoint
State Management: Outbox Pattern for state stores (preview feature)
The outbox pattern enables a single transaction across a state store and any message broker and is a powerful design pattern for sending notifications regarding changes in an application’s state.
In this v1.12 release, the outbox pattern is enabled as a preview feature for any transactional state store.
Dapr Workflow in beta, with Java support
The workflow runtime and APIs have been moved to beta status indicating the next stage of maturity towards stable. The beta APIs are the preferred choice when calling the Workflow APIs directly. [Note: the alpha APIs remain functional to prevent breaking changes]
Additionally, Java SDK is now supported for authoring Workflows, which you can try through the Java workflow quickstarts.
Metadata API improvements
The metadata API on the Dapr sidecar now includes information on the app connection details including the app port, protocol, host, max concurrency, along with health check details as seen from the Dapr sidecar.
Improvement to Dapr actors and Placement APIs
In this v1.12 release we continued to make improvements to Dapr actors, including bug fixes and performance improvements to Actor Reminders.
Some notable changes include:
- A new placement API on the Placement service enables you to examine the placement tables to determine which types of actors are deployed and where they are active. This gives you more insight to actors at runtime and aids in debugging actor issues.
- API calls to Actor (and Workflow) endpoints now block while the Dapr actor runtime is being initialized, so applications don't need to guess anymore when the actor runtime is ready after Dapr has started.
- We have made improvements to the performance of Actor Reminders, reducing reducing the need to perform multiple re-evaluations when more than one Dapr sidecar goes online and/or offline at the same time, and better handling locking to prevent race conditions.
- We have fixed a bug that could cause an actor to be activated on two apps at the same time if a reminder is being executed during a rebalancing.
CLI
- To make setting up a development environment on Kubernetes easier, the
dapr init -k
command now supports a --dev
option which deploy Redis and Zipkin containers to Kubernetes identical to the self-hosted mode. Simply set the Kubernetes cluster configuration context! Give this is try on your locally kubernetes cluster!
- You can now pass multiple resource paths when running applications. For example
dapr run --app-id myapp --resources-path path1 --resources-path path2
. For example you can have a shared folder for components used across many application and a per application specific folder. This applies to any of the Dapr resources.
Multi App run
- Multi-App run enables you to run several applications locally to test them together. Windows is now supported along with Linux and Mac.
- Multi-App run for Kubernetes now makes it easy to launch and run multiple apps with container images at the same time on Kubernetes. Try this out with the hello kubernetes tutorial which saves having to launch multiple command windows to test multiple apps together.
Components
- All bindings now support an optional bindings direction either input vs output. Using a binding direction means that Dapr does not need to query the application for binding information. See binding quickstart for some examples.
- State store API now returns TTL as part of the response metadata, allowing applications to make caching decisions based on the remaining time. 2987
New components
There are over 115+ components in Dapr. One more component has been added in this release:
Pluggable components: Secret stores now supported
Component stabilization
The following components have been promoted to stable status:
Component improvements
The following components have had additional capabilities added:
- Bindings:
- State stores:
- All transactional state stores now return the TTL when retrieving metadata.
- etcd state store now at v2
- Pub/sub:
- Name resolvers:
- PostgreSQL components:
- All PostgreSQL components (binding, configuration store, state store) now support authentication with Azure AD
- WASM components:
- WASM components now support "strict mode", which offers additional protection against side-channel attacks when running untrusted code