New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict Resolution #506

rajagp opened this Issue Apr 13, 2018 · 0 comments


None yet
3 participants
Copy link

rajagp commented Apr 13, 2018


In Couchbase Mobile 1.x, conflict resolution was handled as follows. When concurrent writes to an individual record occurred, each individual write was stored in the system as separate conflicting documents and the conflicts would be resolved asynchronously by custom code running on the client or server. This approach proved to be challenging in a number of ways. The first challenge, was around storage requirements - each conflicting document revision stored in the system has a incremental effect on the storage requirements of the system which is impactful in medium and large scale systems. The second challenge, is around resolving the conflicts once they are in the system - this requires advanced knowledge in distributed systems to write the additional code to resolve conflicts with routines that are efficient, convergent, and deterministic.


Reduce the challenges associated with managing conflicts.

Solution Approach

In Couchbase Mobile 2.0, we have taken our 1st step in reduce the challenges associated with managing conflicts - we now have automatic conflict resolution. When concurrent writes to an individual record occur, the conflict is automatically resolved and only one non-conflicting document is stored in the system. This approach, eliminates the additional storage requirements for storing conflicting revisions and eliminates the need for advanced knowledge in distributed systems to resolve conflicts.

This approach to conflict resolution is efficient, convergent, and deterministic, and it's behavior can be generally compared to Last-Write-Wins from a logical clock perspective. Our current expectation is that this will work for the majority of use cases where the fidelity of conflict resolution at a document level is desired and/or acceptable.

Next steps

For use-cases where this fidelity of conflict resolution is not a good fit, we are exploring more granular mechanisms like 2-way merge, 3-way merge, and CRDTs.

How you can help

We've created this issue for our customers and users to share their use-cases, functional requirements, and anything else that will help us understand what is needed in this area. Please join in the conversation and help us decide how we will progress this area of Couchbase Mobile.

If you're new to this conversation, a great way to start is to provide the following:

  1. A description of your use-case
  2. A description of your functional requirements around conflict
    resolution in the following form:
    a. the first conflicting document
    b. the second conflicting document
    c. the final document that is desired following conflict resolution
  3. A description of how the existing conflict resolution mechanisms don't
    meet the functional needs of your use-case

@rajagp rajagp self-assigned this Apr 13, 2018

@djpongh djpongh added the icebox label May 25, 2018

@snej snej added the f/replicator label Oct 3, 2018

@djpongh djpongh added the pmin label Oct 29, 2018

@rajagp rajagp added the ffc label Nov 30, 2018

@djpongh djpongh added this to the Cobalt milestone Dec 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment