Manage a multi-service “transaction” as a sequence of local transactions + compensating actions.
OrderService -> emits OrderCreated
PaymentService -- listens -> charges card -- emits PaymentCompleted
InventoryService -- listens -> reserves SKU -- emits InventoryReserved
if any step fails:
PaymentService -> emits PaymentRefundNeeded
InventoryService -> emits InventoryRelease
OrderService -> marks order FAILED
A road trip with many stops: each stop is one local task; if the last stop is closed, you reverse course to undo priors.
Interview tip: Always mention compensations are not free — design idempotency from day one.