A flight booked, a hotel confirmed, then the car rental fails. The customer wants the whole trip canceled. But the hotel already committed that reservation — allocated inventory, sent a confirmation email. You can't reach into their system and roll it back. You don't have the authority, and even if you did, the confirmation already went out. What you can do is send a new request: cancel the reservation. That cancellation is its own transaction, with its own consequences — a fee, a refund policy, a record that says booked then canceled, not nothing happened.
Jim Gray named this a "compensating transaction" in 1981, and he traced the logic to something bookkeepers already knew: you never alter the books. If an entry is wrong, you write a correcting entry. Both remain visible.
Six years later, Garcia-Molina and Salem built the saga pattern on this foundation — chains of sub-transactions, each paired with a compensation step, because any process that crosses system boundaries has already given up the ability to atomically pretend nothing happened. You move forward and account for what did.
Wherever a committed act has been witnessed by parties you don't control, erasure isn't available. Correction is always a new act.
Rollback discards uncommitted changes inside a single database before anyone sees them. The prior state is restored exactly; no trace remains.
Compensation applies after a transaction has committed and been observed. It's a new, forward-moving operation — a cancellation request, a correcting journal entry — that approximates the prior state from a business perspective.
Key properties of compensating transactions:
- Additive — both the original action and its correction appear in the record
- Business-specific — what counts as "undoing" a hotel booking depends on the hotel's cancellation policy, not a generic database mechanism
- Can fail — a compensating transaction is itself a transaction, subject to errors, retries, and partial success
- May not fully restore — downstream effects (notifications sent, inventory shuffled, fees incurred) can survive the compensation
The saga sequence for a failed booking:
- Reserve flight ✓
- Book hotel ✓
- Reserve car ✗
- Cancel hotel (compensate step 2)
- Cancel flight (compensate step 1)
Each cancellation is a new committed act, not a rewind.

