Transactional Outbox

A transactional outbox stores an event to be sent in the same database transaction as the business change that caused it. A separate relay reads committed outbox records and delivers them. This couples the durable intent to send with the database change; the broker send is still a separate operation.

Insert an order and its order_placed outbox record together. A rollback leaves neither committed. If the relay sends successfully and crashes before recording success, it may send again after restart. Preserve the event ID and make the consumer’s intended effect retry-safe. Deleting the outbox record before confirmed delivery risks losing the event.

Define ordering scope, delivery monitoring, retry limits, retention and recovery. A backlog can delay analytics even though every order committed. The pattern does not make a multi-service transaction atomic, authenticate event payloads, or guarantee exactly one external effect. Reconcile critical events with the business source.

Reference: AWS transactional outbox.


Discover more from Insightful Data Lab

Subscribe to get the latest posts sent to your email.

Similar Posts

Questions, corrections, or additional insights?

This site uses Akismet to reduce spam. Learn how your comment data is processed.