The dual write problem occurs when your service needs to write to two external systems in an atomic fashion. A common example would be writing state to a database and publishing an event to Apache Kafka. The separate systems prevent you from using a transaction, and as a result, if one write fails it can leave the other in an inconsistent state. This is an easy trap to fall into.
There are valid options for avoiding the dual write problem, such as a transactional outbox, event sourcing, and change data capture. However, we have to be careful to avoid solutions that seem valid on the surface but just move the problem.
We will only share developer content and updates, including notifications when new content is added. We will never send you sales emails. 🙂 By subscribing, you understand we will process your personal information in accordance with our Privacy Statement.