Cross-region saga without 2PC
Your task
An order-fulfillment flow must atomically reserve funds (payments service, us-east), decrement inventory (inventory service, eu-west), and create a shipment (logistics service, ap-south), three services, three databases, three regions. The product needs the whole thing to be all-or-nothing from the user's perspective. The team's first instinct is cross-region two-phase commit (2PC) with a coordinator. Explain precisely why 2PC across regions is dangerous here (blocking, coordinator failure, latency, holding locks across an 80–200ms WAN), then design the alternative that gives the user effective atomicity. Address partial-failure compensation, idempotency, and what 'atomic' realistically means here.
It covers
- Distributed transaction
- Saga
- 2pc
- Cross region