System Design ($200k+) · CONSISTENCY · Distributed Systems Core · 2026

Transactional Outbox Pattern vs Direct Dual-Write (DB + Broker)

Quick Decision Rule: When Updating an Orders table and publishing an OrderCreated event to Kafka without risking partial failures where one succeeds and the other crashes, choose Write both the Order row and an Outbox event row in the same local ACID DB transaction, then relay asynchronously via CDC/poller.

Trigger ConditionUpdating an Orders table and publishing an OrderCreated event to Kafka without risking partial failures where one succeeds and the other crashes
Recommended ChoiceWrite both the Order row and an Outbox event row in the same local ACID DB transaction, then relay asynchronously via CDC/poller
Classic TrapDirect dual-writes across a database and message broker have no atomic commit; a process crash between the two permanently desynchronizes downstream services.
VerificationAudited on 2026-11-23 · Distributed Systems Core · 2026

30-SECOND DECISION TRAP CHECK · CONSISTENCY

Test your instinct

An order service commits to PostgreSQL and on the next line calls `kafka.produce("order.created")`. During deployments, pods occasionally crash between the two lines, leaving paid orders that never ship. What architectural pattern eliminates this split?

Primary Engineering Documentation

Related Consistency Decision Guides