In modern distributed systems, it is common to face the “dual-write” problem. This occurs when a service needs to perform two actions simultaneously: mutate state in a database and publish an event to a message broker (like RabbitMQ, Apache Kafka, or a Pub/Sub system) to notify other services.
Because these two operations target different systems over the network, they cannot share a single, traditional ACID transaction. If one operation succeeds and the other fails, the system is left in an inconsistent state.