Saga
Definition
A saga coordinates a multi-service operation as a series of local transactions; if a step fails, compensating transactions for the completed steps run in reverse order.
In practice
Services own their data, so there is no single ACID transaction across them, and two-phase commit is rarely practical between services. A saga accepts that each step commits on its own and makes failure recoverable through compensation. It can be coordinated by an orchestrator or by choreography through events.
Sagas have no isolation: other requests can see intermediate states, so use pending states, semantic locks and a deliberate pivot step after which the saga only moves forward. Saga state must be persisted, messages published through an outbox, and every participant made idempotent so resends after crashes are safe.
Example
Place order: reserve stock, charge card, create shipment. If the shipment step fails, the saga refunds the card and releases the stock, and the order ends as CANCELLED.