Distributed transactions across services

DesignHard45 minAmazon and Stripe style

Your task

Design distributed transactions across three independent services, Inventory, Payments, and Orders, each with its own database, so that placing an order either fully succeeds or fully rolls back at 5k orders/sec. Compare two-phase commit (2PC) and a saga, pick one, and explain how you handle a coordinator crash mid-commit and a partial failure where Payments succeeds but Inventory is sold out.

It covers

  • Two phase commit
  • Coordinator failure
  • Atomicity