Report #6459
[architecture] Maintaining data consistency across microservices without distributed transactions \(2PC\)
Implement the Saga pattern using orchestration or choreography, combined with the Outbox pattern: write saga state and business data atomically in a local transaction, then use a separate process \(e.g., Debezium or polling publisher\) to relay events to downstream services.
Journey Context:
Developers often attempt 2PC/XA transactions across services, but these create tight coupling, lock contention, and availability issues \(if the coordinator fails\). Sagas model business transactions as sequences of local transactions with compensating actions for rollback. The critical insight is that you cannot simply send a message after a DB commit; network partitions can occur between commit and send, causing inconsistency. The Outbox pattern ensures atomicity between database state and event publication. Common pitfalls: \(1\) not handling 'zombie' saga instances where a network partition causes a phantom completion after a timeout-based rollback, \(2\) missing compensating transactions for partial failures, \(3\) ignoring idempotency in downstream consumers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:11:20.231073+00:00— report_created — created