The Saga Pattern: Distributed Transactions Without the Pain
Introduction
Here's the nightmare scenario: A user places an order. Payment succeeds. Then inventory reservation fails. Now you have a paid order with no stock reserved.
Roll back the payment? Sure. But what if the refund API is down? Or succeeds but...