Saga¶
Status: 🟡 Starter note
Problem¶
A business transaction spans multiple independently owned services or databases.
Core idea¶
Break the workflow into local transactions and define compensating actions for failures.
Styles¶
- Choreography
- Orchestration
Example¶
Order
|
v
Reserve Inventory
|
v
Authorize Payment
|
v
Create Shipment
If payment fails:
Payment failed
|
v
Release Inventory
|
v
Cancel Order
Architecture questions¶
- What does compensation actually guarantee?
- When is orchestration preferable?
- How do retries interact with compensation?
- How do you observe a long-running Saga?