Stateful services in an e-commerce ordering system
Moving forward with the Order-Reservation scenario introduced in the previous chapters, at this stage, we will focus on persisting the state in each Dapr application.
The following diagram anticipates the change in state management that we are going to apply to our microservices:
As you can see in Figure 4.2, the Dapr reservation-service
service is going to use Redis as the state store, while order-service
is going to leverage the Cosmos DB state store.
The following are the project structures used to support the order-service
and reservation-service
Dapr applications:
sample.microservice.dto.order
sample.microservice.order
sample.microservice.dto.reservation
sample.microservice.reservation
I decided to have data transfer object (DTO) libraries that a service client can use to interact with the service itself, separate from the...