Compensation is a new business action, not rollback#
A Saga decomposes a workflow into local transactions. If a later step fails, compensating actions restore an acceptable business state: cancel a reservation, release inventory, or refund a captured payment.
| Orchestration | Choreography |
|---|---|
| Central workflow state and commands | Services react to events |
| Flow visible in one place | Looser runtime coupling |
| Orchestrator owns coupling | Global flow, cycles, and debugging get harder |
A card charge followed by a refund still happened. Compensation can fail, events can duplicate, and a timed-out step may have succeeded; persist workflow state and make steps idempotent.
Use these prompts to extend the design. The useful answer is a reasoned change, not a memorized sentence.
- Which effects are irreversible?
- How does failed compensation retry or escalate?
- How does the workflow resume after a crash?
- What happens if the user cancels mid-flow?
Related practice problems
Use the manifest-backed prompts below to apply this lesson in a complete design.
- Saga distributed transactions patternMicrosoft Azure Architecture Center
- Making retries safe with idempotent APIsAmazon Builders' Library