A saga sequences local transactions and compensating actions. Compensation is a business action, not a perfect rewind of history.
Before you start
You should understand HTTP, database transactions and the difference between one process and independently failing services. Draw the participants and message direction before choosing a pattern. Include timeout, duplicate delivery and recovery in the model instead of considering only successful requests.
The practical goal is to reason through this situation: Cancelling a reserved shipment differs from undoing a shipment already dispatched. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: List local steps
Record each participant’s action and failure outcome.
Step 2: Identify irreversible points
Reservation cancellation differs from reversing a dispatched shipment.
Step 3: Plan recovery
Specify compensation, retries and manual handling when reversal is incomplete.
Worked scenario
Cancelling a reserved shipment differs from undoing a shipment already dispatched.
An order reserves stock, charges payment and dispatches a parcel. Failure before dispatch may permit releasing stock and refunding payment. After dispatch, recovery may require a return process, fees and support intervention. Calling all of those actions ‘rollback’ hides their different business consequences.
Common mistake
A refund may restore money but cannot erase external consequences or fees.
Verify the behavior
Fail each step and assert the documented compensation or manual-recovery state.
Interview exercise
Design failed checkout recovery.
Answer and reasoning
State reversible steps, irreversible points and manual recovery paths before choosing choreography or orchestration.
Continue learning
Compare the scenario with the Microservices interview questions and test your understanding with the Microservices MCQs. For terminology and implementation details, consult the reference material.