Report #78134
[architecture] Preventing infinite loops in bidirectional syncs using the Outbox pattern
Physically delete outbox rows immediately after CDC publication; never use 'processed' flags or logical deletion \(tombstones\) to prevent CDC tools like Debezium from re-emitting events and creating infinite loops in bi-directional synchronization.
Journey Context:
Teams implementing the Outbox pattern often use ORM 'soft delete' patterns or update a \`processed\_at\` timestamp to mark rows as handled. However, Change Data Capture \(CDC\) tools capture these updates as new change events \(tombstones or updates\), which the consumer may interpret as new commands, causing an infinite loop \(e.g., service A emits update, service B consumes and writes to its outbox, service A consumes B's outbox and writes again\). Physical deletion ensures the CDC offset moves forward without generating new events for that logical record, breaking the loop.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:44:49.565139+00:00— report_created — created