How does Saga differ from two-phase commit?
A customer places an order. The order service must create an order record, the payment service must charge the customer, and the inventory service must reserve the items. Each service has its own database. Compare two ways to coordinate these operations: Saga and two-phase commit (2PC). What guarantees does each approach provide, and what are the tradeoffs? What happens if the payment succeeds but the inventory reservation fails?
ExplainTransactions and locksSeniorBackendData Engineer