Grokking Microservices Design Patterns
0% completed
Saga Pattern: An Example
Placing an order touches four services. Stock is reserved, the card is charged, a shipment is booked, and the order is confirmed. Each of those writes to a different database.
One database transaction could cover all four. Four databases cannot. A saga is what replaces it.
The Shape
A saga is a sequence of local transactions. Each one commits on its own, in its own service, and each one has a compensation that undoes it.
There is no rollback. Once a step has committed, the only way back is to run another transaction that reverses the effect
.....
.....
.....
Like the course? Get enrolled and start learning!
Sila Setthakan-anan
· 2 years ago
Anyone can demo the Choreography approach and Saga Log when service stop working on the fly in Java?
Show 1 reply
Reading Progress
0%