← All patterns The problem Checkout spans inventory, payment and shipping, each with its own data. A later failure leaves earlier steps committed.
When it fits A business operation spans independently committed services and can define compensations or a recovery process.
The whole architecture
Architecture diagram Download SVG A durable coordinator runs local service transactions and records business compensation when a later step fails.
Blue arrows are service/data calls. Compensation names describe new business actions, not a global rollback.
saga architecture A durable coordinator runs local service transactions and records business compensation when a later step fails. Blue arrows are service/data calls. Compensation names describe new business actions, not a global rollback. Workflow coordination Independent service transactions client → coordinator: start coordinator → workflow: checkpoint coordinator → inventory: reserve / release coordinator → payment: authorize / reverse coordinator → shipping: ship inventory → stock-data: local commit payment → payment-data: local commit shipping → shipping-data: local commit start checkpoint reserve / release authorize / reverse ship local commit local commit local commit The product needs a way to report pending and recovered outcomes. Checkout client Begin a workflow An orchestrator is one saga coordination approach; choreography is another. Saga coordinator Durable workflow state Retain enough progress to retry or reconcile after a coordinator crash. Workflow store Completed / pending steps Release is a compensating business operation. Inventory service Reserve / release stock Payment reversal can fail and may require reconciliation. Payment service Authorize / reverse Irreversible steps need an explicit point-of-no-return policy. Shipping service Arrange shipment This service owns its own transaction domain. Inventory data Local transaction This is separate from inventory and shipping commits. Payment data Local transaction A later failure does not erase earlier committed business history. Shipping data Local transaction Select a component, or focus it and press Enter, to read its role.
Compensations can fail and require retries or manual recovery. Independent local commits do not form a single cross-service ACID transaction. Walk through the design
Follow one operation Core flow Failure & recovery
Select a step to highlight its participants. This conceptual walkthrough is separate from challenge scoring.
Arrows show the conceptual relationships used by this walkthrough.
1 Reserve inventory2 Authorize payment3 Arrange shippingStep 1 of 3 Reserve inventory The coordinator requests a local inventory reservation transaction.
← Previous Restart Next step →
Trade-offs to make explicit Compensation is a new business action; it does not erase history or provide database rollback. Concurrent operations can observe intermediate states. Define reservations, isolation strategies and points of no return. Failure modes to plan for A compensation can fail and require retries or manual reconciliation. Repeated commands need idempotent handling, and irreversible steps need an explicit recovery policy. Before you build Explain your decision If a refund fails after inventory is released, what durable state tells an operator which action still needs recovery?
Use Plan & estimate inside practice to record your assumptions and trade-offs.
These links open the original challenges. Existing round unlocks, completions and points apply.
One transfer, two attempts Related prerequisite in idempotent local effects. This challenge uses one SQL transaction domain and does not score cross-service sagas.
Open challenge → Further reading Microsoft · Saga ↗
Original PractiseGrid explanations and conceptual diagrams, with primary references for further study. Dedicated scored exercises can be added as coverage grows.