Placing an order touches three services: inventory reserves stock, payments authorizes the card, shipping creates a shipment. In a monolith that is one database transaction. Split into services with their own databases, there is no transaction that spans all three, and two-phase commit across services is rarely an option in practice.
The saga pattern is the standard answer. This post explains how a saga works, the difference between orchestration and choreography, how compensations and pivot steps fit together, and the isolation problems sagas do not solve for you. The diagram shows an orchestrated order saga.
What a saga is
A saga is a sequence of local transactions. Each step commits in its own service's database and triggers the next. If a step fails, the saga runs compensating transactions that undo the effects of the steps that already committed.
The idea is older than microservices: Hector Garcia-Molina and Kenneth Salem described sagas in a 1987 paper about long-lived database transactions.…