Report #14539
[architecture] Implementing distributed transactions across microservices safely
Use the Saga pattern with compensating transactions instead of 2PC; prefer Orchestration over Choreography for complex flows requiring centralized failure handling and deterministic compensation order.
Journey Context:
2PC \(Two-Phase Commit\) is a blocking protocol; if the coordinator crashes after prepare, resources are locked indefinitely. It's a denial-of-service vector. Sagas model a long-lived transaction as a sequence of local transactions, each publishing an event. If step 3 fails, run compensating transactions for steps 2 and 1 \(e.g., credit refund\). Choreography \(event-driven\) couples services implicitly; Orchestration uses a central state machine \(e.g., Temporal, Camunda\) that explicitly knows the flow, making debugging and compensation ordering deterministic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T21:48:41.448198+00:00— report_created — created