Practice this topic in a realistic system design interview
The Outbox pattern lets a service update its database and publish an event without a distributed transaction across the two.
The problem it solves is the dual-write problem. A service that commits to its database and then publishes to a message broker is updating two independent systems. Either side can succeed while the other fails, and no safe ordering between the two writes makes both atomic.
The pattern removes that dual write. The service writes the business change and an event record in the same local database transaction. A separate relay later reads the outbox table and publishes the message to the broker. The database remains the source of truth, and the broker becomes an asynchronous projection of committed facts.