Report #79658
[architecture] Ensuring message delivery and database updates are atomic without 2PC
Implement the Transactional Outbox: write events to a dedicated 'outbox' table in the same DB transaction as business data; use a separate relay process to poll and publish to the message bus.
Journey Context:
Developers often publish to Kafka then commit the DB, risking double execution if the commit fails \(message is sent but transaction rolls back\). XA/2PC is operationally toxic \(blocking, coordinator failure\). The outbox pattern provides 'at least once' delivery with idempotent consumers, avoiding distributed transactions entirely. The relay must tolerate duplicates and use a high-water mark for polling.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:18:31.645829+00:00— report_created — created