┌─────────────────────────────────────────────────────────────────────────────┐ │ DISTRIBUTED TRANSACTION ≠ │ │ "MANY DBs BEHAVING LIKE ONE DB" │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ Distributed Transaction = │ │ ┌─────────────────────────────────────────────────────────────────┐ │ │ │ Workflow coordination │ │ │ │ + │ │ │ │ Failure handling │ │ │ │ + │ │ │ │ Retry safety │ │ │ │ + │ │ │ │ Compensation │ │ │ │ + │ │ │ │ Reconciliation │ │ │ └─────────────────────────────────────────────────────────────────┘ │ │ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ Order DB │ │ Payment DB │ │ Inventory DB│ │ │ │ (Service A)│ │ (Service B)│ │ (Service C)│ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │ │ │ │ │ │ └──────────────────┼──────────────────┘ │ │ │ │ │ Each service has its own │ │ commit boundary │ │ │ └─────────────────────────────────────────────────────────────────────────────┘
Core question: What happens if step 2 succeeds and step 3 fails?