2.3 KiB
Dapr use cases
This document briefly describes scenarios that Dapr enables for your microservices. Each use case is accompanied with a link to learn more details.
Pub/Sub
Dapr provides an API that enables event-driven architectures in your system. Each microservice can utilize the same API to leverage one of many supported event buses. Microservices can communicate each other by sending or subscribing to events on specific topics. By leveraging this communication style, your microservices remain flexible and loosely coupled.
Visit the following documents to learn more:
Actors
Dapr provides an API and runtime that allows you to write your business logic as an isolated unit, without worrying about concurrency or other actors. Dapr calls this single isolated unit an "actor". Your running actors can send a message to another actor or can request to create a new actor. In the former case, Dapr manages routing the message to the proper destination. In the latter case, Dapr manages all the state management, synchronization, and concurrency involved with starting the new actor.
The actor model is a battle-tested programming pattern and as such, comes with very specific use cases:
- You have a large system composed of many (thousands or more) small microservices, in which the code to manage these microservices (e.g. distribution across nodes, failover, ...) is very complex
- Your microservice(s) do not need concurrent access to state and can instead can share state by communicating
- Your code does operations that have unpredictable latency, such as I/O operations to external web services
Visit the following documents to learn more: