Transactional outbox

Write outgoing messages to an outbox table in the same DB transaction as the state change, then relay them.

The outbox pattern solves the dual-write problem: updating a database and publishing a message cannot be atomic across two systems. The service stores the event in an outbox table within its local transaction, and a separate relay (polling or change-data-capture) publishes it to the broker. Consumers must tolerate duplicates because delivery is at-least-once.

Type
Architecture pattern
Category
Architecture
License
Free
Pricing
Free
Level
Advanced
Technologies
architecture, messaging, databases
Last verified
26 Nov 2026

What Transactional outbox is used for

  • Reliable event publishing from services
  • Sagas and event-driven integration

Strengths

  • No lost events
  • Uses the existing database transaction

Limitations

  • Extra relay infrastructure
  • At-least-once delivery requires idempotent consumers

How it relates to other tools

Built with the same technologies

Official links

Sources

Explore