Multiple ChoiceBeginner 45s
Transaction outbox in modular monolith
A modular monolith writes to its database and then publishes an integration event to a broker. Messages are occasionally lost when the process crashes between the two steps. What is the correct fix?
Options
- 1Publish the event to the broker first, then write the state change to the database table
- 2Wrap both the database write and the broker publish in a distributed two-phase commit
- 3Write the event to a transactional outbox table in the same DB transaction, then relay it to the broker
- 4Retry the publish in a background thread a few times after the database commit returns
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.