Report #15090
[architecture] Managing distributed transactions across microservices without tight coupling
Implement the Saga pattern using orchestration \(central coordinator service\) or choreography \(event-driven\) to break distributed transactions into a sequence of local transactions, each with a compensating transaction for rollback; avoid two-phase commit \(2PC\) entirely.
Journey Context:
Two-phase commit blocks resources during the prepare phase, creates deadlocks if the coordinator fails, and violates availability under network partitions \(CP in CAP theorem\). Sagas accept eventual consistency and isolate failures via compensating actions: if 'reserve payment' succeeds but 'deduct inventory' fails, execute 'refund payment' as compensation. Orchestration uses a central saga coordinator \(easier to debug, track state, and handle timeouts\); choreography has services listen to each other's events \(decoupled but requires careful event schema evolution\). The failure mode is neglecting idempotency in compensations: if the compensation itself retries, you must ensure it doesn't create duplicate refunds. Sagas also require handling 'orphan' saga instances where the coordinator crashes mid-flight, necessitating reconciliation jobs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:12:32.959585+00:00— report_created — created