CSE Roadmap

Specialist tier · about 2 hours · 5 parts

Part 3 of 5 · 1 min read

Write conflicts

Two leaders can each independently accept a conflicting change to the same data before either has heard from the other.

Think of two different regional offices each independently approving a change to the exact same shared order, at nearly the same moment. Neither office is aware of the other's change until the mail between them eventually arrives.

In plain words: a write conflict happens when two different leaders each accept a write to the same data item before either leader has received the other's change, since with no single ordering point, as there was in single-leader replication, nothing stops this from happening. Once each leader's change eventually reaches the other, the system is left holding two different, conflicting values for the same data item, with no inherent way to know which one should actually win.

A worked example. A customer's shipping address is updated to one new value on the leader in region A, and to a different new value on the leader in region B, at nearly the same moment, before either region's leader has received the other's change.

The key lines. No new SQL; a write conflict is detected when replicated changes from different leaders are compared and found to disagree about the same data item.

Write conflict

A write conflict occurs when two different leaders each accept a change to the same data item before either has received the other's change, leaving two disagreeing values once both changes eventually arrive everywhere.

Example: two regional offices each independently approving a different change to the same shared order, before either learns of the other's change, is a write conflict.