Skip to content
Commitwise
Menu

Saga

A business transaction across services made of local transactions, each with a compensating action that undoes it if a later step fails.

Definition

Instead of a distributed transaction, each service commits its own step and publishes a message that triggers the next. If a step fails, compensations such as refunds or releases run in reverse order. Sagas can be coordinated by choreography (services react to events) or orchestration (a coordinator with persisted state).

In practice

Charge the card, reserve stock; if stock is unavailable, refund the payment and cancel the order.

Learn it in context

Lessons that use this term.

Related terms

Esc

Type to search the whole site.