Report #11613
[architecture] Distributed transactions blocking services and creating tight coupling via 2PC \(Two-Phase Commit\)
Use Saga pattern for long-running distributed transactions: sequence of local transactions with compensating transactions for rollback; choose choreography \(event-driven\) for loose coupling or orchestration \(central coordinator\) for complex flows
Journey Context:
2PC locks resources across services during prepare/commit phases, requiring a transaction coordinator \(single point of failure\) and blocking participants. If coordinator fails mid-commit, resources stay locked. Saga avoids locks by executing steps sequentially, using compensations \(e.g., credit account if debit failed\) for semantic rollback. Choreography \(services listen to events\) decouples but is harder to trace; Orchestration \(saga coordinator\) centralizes logic but is a single point of failure \(though stateless and restartable\). Tradeoff: sagas lack isolation \(reads see partial updates\), requiring 'semantic lock' patterns or accepting eventual consistency. Use 2PC only for short, critical financial operations where absolute isolation trumps availability; use Sagas for long-running business processes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:46:58.760199+00:00— report_created — created