Multi-Master Replication - Why Conflicts Happen
Source: https://arpitbhayani.me/blogs/conflict-detection Date: 2021-11-28
Understand conflicts in multi-master databases - Learn how to detect and resolve data inconsistencies for reliable systems.
Every multi-master replication setup comes with a side-effect - Conflicts. Conflict happens when two or more database accepts conflicting updates on the same record. We say that the updates are conflicting when we are unable to resolve them to one value deterministically. In this essay, we talk about conflicts and understand what they are, how to detect them.
Conflicts
Say we are building an online book store allowing users to purchase books at the click of a button. Like any e-commerce application, even ours has a , which acts as a staging area for everything the user shops for. The user likes a book, adds it to the cart, and proceeds to pay once the shopping is done, proceed to payment. When a user adds a book to the cart, this operation can never be forgotten or rejected - as it will result in loss of revenue and a very poor user experience.


