Problem Statement
Why use the Transactional Outbox pattern?
Explanation
Write domain changes and the outbound event to the same database transaction. A relay process reads the outbox table and publishes to the broker. This avoids dual-write races.
It improves reliability when you cannot use distributed transactions.
Code Solution
SolutionRead Only
BEGIN; UPDATE order...; INSERT outbox(event_json); COMMIT;
Practice Sets
This question appears in the following practice sets:
