Using Actors
In this chapter, you will learn about the powerful virtual actor model, as implemented in Dapr, and how to leverage it in a microservices-style architecture, along with the pros and cons of different approaches. The actor model enables your Dapr application to efficiently respond to scenarios of high resource contention by streamlining state management.
In this chapter, we will cover the following main topics:
- Using actors in Dapr
- Actor concurrency, consistency, and lifetime
- Implementing actors in an e-commerce reservation system
The entry barrier for adopting actors in Dapr is lower than the complexity behind the core concepts of the virtual actor pattern. Nonetheless, a solid understanding of the scenarios for actors – including the ability to recognize bad practices and avoid any pitfalls – is a prerequisite for their adoption. Therefore, we will start by providing an overview of the actor model before moving on to its lab implementation...