Report #12370
[architecture] Using 2PC \(two-phase commit\) or distributed transactions to maintain consistency across microservices
Replace 2PC with the Saga pattern using either choreography \(event-driven\) or orchestration \(central coordinator\) to manage long-running transactions without locks, implementing compensating transactions for rollback
Journey Context:
Two-phase commit creates a deadly bottleneck: the coordinator becomes a single point of failure, and resources remain locked during the prepare phase, causing cascading timeouts under load. The Saga pattern avoids locks by breaking transactions into a sequence of local transactions, each with a compensating action. If step 3 fails, you run compensating transactions for steps 2 and 1. The choice between choreography \(services listen to each other's events\) and orchestration \(a central Saga manager commands steps\) depends on complexity—choreography risks circular dependencies and 'event spaghetti,' while orchestration risks the coordinator becoming a god service, though it's easier to trace and debug.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:48:56.290328+00:00— report_created — created