Question
Design the transaction model for an order-and-payment flow that spans three independently-deployed services with separate databases: Inventory (reserve stock), Payment (charge card), and Shipping (create shipment). The flow must be atomic in effect — never charge a card without reserving stock, never ship without a successful charge — at 5k orders/sec, with services that can fail or be slow independently, and no shared database. Choose a coordination model (2PC vs saga vs outbox), justify it, describe failure handling, and the central trade-off.
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.