How to Resolve Conflicts with Automatic Conflict Resolution

Conflict resolution rules can become complicated and custom code can be prone to errors.

Effects of conflict resolution handler

๐Ÿ›’ Example: Amazon has had some interesting effects when utilising a conflict resolution handler.

It has been documented that for some time the conflict resolution logic on the shopping cart preserves items added to the cart. BUT not when items are being removed from the cart.

๐Ÿค” Therefore, sometimes customers may find items reappearing in there shopping carts, when they have been previously been removed.

Research on automatic conflict resolution for concurrent data modifications ๐Ÿ”ฌ

There are conflict free replicated data types (CRDT). Family of data structures for:

  • Sets
  • Maps
  • Ordered lists
  • Counters

These can be concurrently edited by multiple users, which can automatically resolve conflicts in sensible ways.

Some CRDTs have been implemented in Riak version 2.0, using a 2 way merge.

Mergeable persistent data structures track history explicitly. This is similar to the Git version control systems, and this can use a 3 way merge function.

For more reading behind merge functions: Git Fast-forward merge vs three-way merge

Conflict resolution algorithm: Operational Transformation

This algorithm is behind the collaborative editing applications such as:

  • Google docs
  • Etherpad

The algorithm was designed for editing concurrent lists of items, such as a list of characters that make up a text text document.

Implementations of these algorithms are still in use today in integrated replicated systems.

โœ… Automatic conflict resolution could make multi-leader synchronisation much simpler to deal with.

3 thoughts on “How to Resolve Conflicts with Automatic Conflict Resolution

Leave a comment