Saga: Orchestration vs Choreography - Junior¶
A Saga splits a long transaction into local commits and compensating actions.
flowchart LR
Order --> Reserve --> Charge --> Ship
Charge -->|fails| Undo[Release reservation]
There is no database rollback across services. A compensation is a new business action and can also fail. Orchestration uses one coordinator; choreography lets services react to events.
Test yourself¶
- Why is compensation not rollback?
- What does an orchestrator own?
- How can choreography hide the workflow?
Continue to middle.md.