Architecture

Saga pattern

Long-running distributed transaction as a sequence of compensable steps.


In plain terms

Each step has a corresponding compensation. Replaces 2PC for cross-service transactions where atomicity isn't feasible.

Origin

Hector Garcia-Molina and Kenneth Salem, "Sagas," ACM SIGMOD 1987. Originally a long-lived database transaction technique; revived in 2014+ as the answer to "distributed transactions without 2PC."

Where it shows up in production
  • Booking systems Book flight + hotel + car. Each step has a compensating cancellation if a later step fails.
  • AWS Step Functions Express workflows orchestrate sagas with built-in compensation transitions.
  • Temporal / Cadence Workflow engines designed around the saga shape.
Sources & further reading
Found this useful?