Report #88450
[architecture] Dual-write failure: database commits but message broker publish fails, or vice versa
Use Transactional Outbox pattern: write events to an outbox table in the same ACID transaction as business data; use a separate relay process to poll and publish with at-least-once semantics.
Journey Context:
Developers attempt to use distributed transactions \(2PC/XA\) or try to order the commits \(DB first, then broker\), both of which fail under network partitions. The outbox pattern recognizes that the RDBMS is the single source of truth. By writing the event to a dedicated outbox table atomically with the business transaction, you guarantee consistency. A background relay process \(poller or CDC like Debezium\) reads the outbox, publishes to Kafka/RabbitMQ, and marks rows as processed or deletes them. The critical insight is that consumers must be idempotent \(see idempotency keys\) because the relay provides at-least-once delivery. Do not attempt exactly-once delivery across heterogeneous systems.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T07:02:52.059414+00:00— report_created — created