Back to Catalog
Cloud
aws
Transactional Outbox
Ensure reliable message publishing by storing messages in the database as part of the transaction
Intent & Description
The Transactional Outbox pattern ensures reliable message publishing by storing messages in the database as part of the transaction that updates business entities. A separate process then reads these stored messages and publishes them to the message broker. This guarantees that messages are published atomically with database updates.
Real-world Use Case
Use when you need to guarantee that database updates and message publishing happen atomically or when implementing reliable event publishing in distributed systems.
Source
Advantages
- Atomic database updates and message publishing
- No message loss
- Reliable event publishing
- Handles failures gracefully
Disadvantages
- Additional database table required
- Separate message publisher process
- Potential for message duplication