Saga

Domain
Distributed data & workflows
Status
ADOPT
Reviewed
2026-11
Tags
transactions, consistency, microservices

TL;DR

Split a business transaction that spans several services into a sequence of local transactions. If a step fails, run compensating actions to undo the steps that already committed. You trade atomicity and isolation for availability and loose coupling.

Problem it solves

Placing an order touches Orders, Payments and Inventory, and each service owns its own database. A single ACID transaction can’t span them. Distributed two-phase commit (2PC) holds locks across the network, most modern brokers and datastores don’t support it, and it fails badly when one participant is slow.

A Saga gives up on making all the writes atomic. Instead, it guarantees that the system ends up in a consistent business state: either every step completes, or the completed steps are undone semantically.

How it works

Each step is a local transaction that commits immediately and triggers the next one. Each step also has a compensating transaction, a business-level undo such as refund for charge.

Use it when / Avoid it when

Use it when

Avoid it when

Trade-offs

dimension saga 2PC
consistency Eventual, with no isolation between steps Atomic, but blocks if the coordinator fails
availability No locks held across services Every participant must be up
simplicity You write compensations, idempotency and timeouts The complexity lives in the infrastructure
observability Needs correlation IDs and saga state tracking One transaction, one outcome
cost A workflow engine or broker, plus engineering time Few modern datastores or brokers support it

In the wild

Volatile, verified 2026-11.

Pitfalls

Go deeper