Quick Decision Rule: When Coordinating a checkout flow across independent Order, Inventory, and Payment microservices with distinct databases and third-party APIs, choose Saga pattern executing local ACID transactions with idempotent compensating rollback steps on downstream failure.
| Trigger Condition | Coordinating a checkout flow across independent Order, Inventory, and Payment microservices with distinct databases and third-party APIs |
|---|---|
| Recommended Choice | Saga pattern executing local ACID transactions with idempotent compensating rollback steps on downstream failure |
| Classic Trap | Distributed 2PC holds blocking locks across microservices during network partitions, collapses throughput, and cannot span external HTTP payment APIs. |
| Verification | Audited on 2026-11-23 · Distributed Systems Core · 2026 |
30-SECOND DECISION TRAP CHECK · CONSISTENCY
A travel booking flow spans Flight Service (Postgres), Hotel Service (MySQL), and an external Stripe API. An engineer proposes Two-Phase Commit (XA/2PC) across all three. Why does this fail in production?
2PC is blocking, fragile across network partitions, and unsupported by external REST APIs. Sagas execute local transactions plus compensating rollbacks on failure.
Trap: Reaching for 2PC across loosely coupled microservices locks databases and breaks when any external API is involved.