The Desi Architect
Notes / Messaging and Correctness / Transactional Outbox
Track 4 · Messaging and Correctness

Transactional Outbox

Saving to your database and telling the broker are two separate writes, and one of them will eventually fail alone. The outbox turns "tell the broker" into a row that commits with your data, so the event can be late but never lost.

Guide20 min read1 interactive
On this page
  1. The customer who paid and got nothing
  2. The simple version
  3. The dual-write problem
  4. The fix: write the event in the same transaction
  5. The polling publisher
  6. Duplicates are normal, so make the consumer safe
  7. Ordering: the part that surprises people
  8. CDC: let the database log be the relay
  9. Housekeeping: the outbox grows forever if you let it
  10. Failure, poison messages and schema changes
  11. Watch the lag
  12. See it happen
  13. When to use it, and when not to