← Back to microservices patterns map
📤
Microservices Pattern

Transactional Outbox

Write business data and outgoing event records in one local database transaction.

reliable events

Detailed Description

The outbox solves the dual-write problem: updating data and publishing a message cannot be atomic across DB and broker.

A relay or CDC process later publishes the outbox row to the broker.

Visual Diagram

DB transaction:
1. update order
2. insert outbox event
Poller publishes event later

Tradeoffs

Pros

Reliable event publishing with local transaction

Cons

Outbox polling and cleanup required

Examples: Debezium outbox transform, custom outbox poller