Saga vs Two-Phase Commit
You need one business outcome across services that each own their data. Pick the consistency model that matches the failure you can live with.
The rule
Prefer Saga when each service owns its store and every step can be compensated. Prefer Two-Phase Commit only when every participant can prepare and you accept blocking locks.
Choose Saga when
Throughput matters, intermediate states are visible and acceptable, and each step has a real business compensation.
Choose 2PC when
You need strict atomicity, participants support prepare, and lock hold time stays short under load.
Situation
Order, payment, inventory, and shipping each keep their own database. A single click must end consistent. A shared lock across those stores is either unavailable or too expensive under load.
Counter-signals
- One service and one database can own the whole flow — use a local transaction instead.
- A step has no honest compensation (irreversible external side effect) — move it last or redesign.
- Participants already expose XA prepare and volume is low — 2PC may still be cheaper than a saga engine.
- Observers cannot see intermediate states — a saga will surface them and may be the wrong tool.
Deep links
Left patternSaga
How to hold a business transaction together across services when there is no distributed lock to save you: compensation, orchestration vs choreography, and semantic locks.
Right patternTwo-Phase Commit
The textbook protocol for atomic commit across multiple resources: how prepare-then-commit works, why a coordinator crash can block participants indefinitely, and where 2PC is still the right answer.