creational

Saga

Maintain data consistency across services without a distributed transaction, by splitting the work into local transactions each paired with a compensating action.

Placing an order might charge a payment, reserve stock and book a shipment. Each of those lives in a different service with its own database.

Booking a trip through separate airline, hotel and car sites. Each booking confirms on its own. If the car falls through you do not un-book the flight — you cancel it, which may cost a fee and is visible on your statement. The trip ends up consistent; the intermediate mess really happened.

Key Concepts

1
Within one database you would wrap all of it in a transaction and roll back on failure. Across services you cannot. A distributed transaction holds locks over the network and stops everything if the coordinator dies, so it is avoided in practice.
2
A Saga breaks the work into steps. Each step commits on its own, in its own service. Each step also has an undo action. If a later step fails, the earlier ones are undone in reverse.
3
One point matters most in interviews. Undoing is not rolling back. The payment really happened, and anyone looking would have seen it. The refund is a separate action that comes after. You get the right final outcome, not a hidden middle.