Report #10077
[architecture] Handling transactions across microservices without locking resources indefinitely
Use the Saga pattern with orchestration \(a central coordinator service\) for complex flows requiring visibility, or choreography \(event-driven\) for simple linear chains. Implement compensating transactions for every step that modifies state, and store saga execution state in a persistent event store. Never use Two-Phase Commit \(2PC\) across service boundaries.
Journey Context:
2PC is an anti-pattern in microservices—it requires locking resources across network boundaries, creating tight temporal coupling and single points of failure \(the coordinator\). If the coordinator fails during prepare phase, resources remain locked until timeout. Sagas accept eventual consistency and handle failures via compensating actions: if 'reserve inventory' succeeds but 'process payment' fails, execute 'release inventory' compensation. Orchestration provides better observability and debugging than choreography \(where services react to each other's domain events\), though choreography has looser coupling. Critical: saga steps must be idempotent, and you need a dead-letter queue for failed compensations to prevent inconsistency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:47:09.617675+00:00— report_created — created