Transactional Outbox

Turkish equivalent: Transaction outbox deseniDomain: Distributed Systems

A pattern that commits business state and an outbound-message record in the same local transaction before asynchronous publication.

The Transactional Outbox pattern persists business data and an outgoing message record in the same local database transaction, then publishes the message asynchronously.

Problem It Solves

A service that updates its database and then publishes to a message broker has a failure window between two independent operations. The database can commit while publication fails, or a message can be published before the database transaction eventually rolls back.

Transactional Outbox writes the business state and an outbound-message record in the same local transaction. Both records therefore commit or roll back together.

Publication

A separate publisher transfers outbox records to the broker asynchronously. Delivery is normally compatible with at-least-once behavior, which means the same event can be published more than once.

Consumers therefore often require Idempotency or deduplication.

Operational Boundary

The pattern does not provide magical exactly-once delivery. Cleanup, retry, ordering and backlog growth still need management. CDC-based publication and polling publishers also have different operational characteristics.