We were promised that microservices would make our software more stable and easier to scale horizontally. But the added complexity often creates a lot of shared code and complex infrastructure. Dapr promises a solution by placing these cross-cutting concerns outside your code.

What Is Dapr?

Dapr (short for "Distributed Application Runtime") is an open-source, portable runtime designed to abstract the complexities of distributed systems away by moving them to a sidecar. Your application can then simply call REST or gRPC APIs provided by that sidecar without the need of special frameworks or libraries.

For convenience, language specific libraries are available (For JVM, .NET, Python, JS and others). These libraries only contain a simple wrapper around the gRPC API. All "difficult" logic is in the sidecar.

dapr architecture

Building blocks

Dapr provides you with building blocks to help you with common challenges developers encounter regularly when building distributed applications. Currently, there following building blocks are available:

  • Publish and Subscribe

  • Service Invocation

  • Secret Management

  • I/O Bindings

  • State Management

  • Virtual Actors

You can simply pick the blocks that suits your needs. If you don’t need - or like - a building block, just leave it out or use another solution. Dapr doesn’t require you to go "all-in". Each building block can be configured to use different backends. For example, The PubSub block can be configured to use Apache Kafka, Pulsar, RabbitMQ and several other backends.

Advantages

  • Simplified Microservices Development: Developers can focus more on business logic and less on the underlying infrastructure.

  • Language and Platform Agnostic: Because Dapr is designed to be language-agnostic, you can use it with multiple programming languages. This flexibility allows developers to choose the language they are most comfortable with or that best suits the specific requirements of their project.

  • Cloud and Platform Independence: Dapr is not tied to a specific cloud provider or platform. It can be used in various clouds, providing a consistent development and runtime experience across different infrastructures.

  • Interoperability: Dapr is designed to work seamlessly with existing technologies and services. There are more than 80 building blocks available, so there is a big chance that the technology that you are using is already supported.

Disadvantages

  • Dapr seems to be very popular in the .NET world, but does not seem to have a lot of traction in the Java/JVM world (yet?).

  • Because Dapr provides a common API around several technologies, specialized functionality is not always available via Dapr.

In a next blog post I’ll show you can start using Dapr in your own applications.

shadow-left