-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Persistence Best Practices for Java Applications
By :

Dual-write is a pattern or approach in software development where data is simultaneously written to two or more separate systems or databases in real time. Dual-write aims to ensure data consistency and synchronization across multiple systems that serve different purposes or require additional data. The following diagram shows this operation, where a single web app writes multiple times to a database, a cache, and a second application.
Figure 10.3: Dual-write operation
While dual-write may seem convenient for data integration and synchronization, it is generally considered an anti-pattern. But what happens if one update succeeds and the other fails? Here are a few reasons why dual-write can be problematic: