Skip to content
Kafka Is FunProgress

AdvancedArchitecture

What is the Outbox Pattern and how does Kafka enable it?

Reference answer

The Outbox Pattern solves the dual-write problem (writing to DB and sending to Kafka atomically without distributed transactions). Pattern: 1) Business transaction writes to DB AND inserts a 'pending event' row in an outbox table — both in one ACID transaction. 2) A separate process (Debezium CDC connector or polling publisher) reads the outbox table and publishes events to Kafka. 3) On successful publish, mark outbox row as processed. This guarantees: DB write and Kafka publish are eventually consistent, no orphaned DB writes without events, no events without corresponding DB writes. Debezium CDC + Kafka is the canonical implementation.

Expected key concepts: Outbox Pattern, dual-write, ACID transaction, outbox table, Debezium, CDC, polling publisher, eventually consistent, orphaned, canonical implementation