Report #11819
[architecture] Distributed locks and two-phase commit bottlenecks in microservices
Implement sagas: sequence of local transactions where each step publishes an event to trigger the next; for failures execute compensating transactions \(semantic undo\); use orchestration \(central coordinator\) for complex flows, choreography \(event-driven\) for loose coupling
Journey Context:
XA/2PC across services creates tight coupling, kills availability \(locking resources during prepare phase\), and fails on network partitions. Sagas accept eventual consistency. Critical insight: you must design compensating logic upfront \(e.g., if payment succeeds but inventory fails, issue refund\). Without idempotency keys, retries in sagas create duplicate side effects. Orchestration is easier to debug \(central state machine\) but couples services to coordinator; choreography is more decoupled but requires correlation IDs across logs. The common error is trying to enforce ACID across services rather than embracing compensation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T14:21:16.472764+00:00— report_created — created