Grokking Microservices Design Patterns
Vote

0% completed

The Transactional Outbox: A Solution

The last lesson ended with three requirements for a real fix. The event must be recorded atomically with the data change. It must survive a crash. It must eventually reach the broker at least once. The Transactional Outbox Pattern meets all three. It needs only one extra table and one small background process. This lesson explains how.

One Transaction Instead of Two

The dual-write problem exists because one operation writes to two systems. The database and the message broker cannot share a transaction. The outbox pattern removes the second system from the operation.

Here is the change

.....

.....

.....

Like the course? Get enrolled and start learning!