Transactional outbox
Also called: outbox pattern, transactional messaging outbox
The transactional outbox pattern coordinates a database change with a message that must eventually be published. The application writes both its business data and an outbox record in one database transaction. A separate relay later publishes the committed outbox record. This avoids the gap where a database commit succeeds but the corresponding direct message send fails.
For example, confirming a ticket reservation also inserts a “reservation confirmed” event in the same transaction. A relay publishes that event after commit and retries after outages. If it publishes and crashes before recording progress, it may publish again. Consumers therefore need duplicate handling; the pattern alone does not guarantee exactly-once effects across the database, broker and downstream services.
- Further reading
- AWS Prescriptive Guidance — Transactional outbox pattern