@prescrire/pouchdb

3.0.0 • Public • Published

Conflicts resolution

PouchDB and CouchDB are using the same deterministic algorithm for conflicts resolution.

CouchDB guarantees that each instance that sees the same conflict comes up with the same winning and losing revisions. It does so by running a deterministic algorithm to pick the winner. The application should not rely on the details of this algorithm and must always resolve conflicts. We’ll tell you how it works anyway. Each revision includes a list of previous revisions. The revision with the longest revision history list becomes the winning revision. If they are the same, the _rev values are compared in ASCII sort order, and the highest wins. So, in our example, 2-de0ea16f8621cbac506d23a0fbbde08a beats 2-7c971bb974251ae8541b8fe045964219. One advantage of this algorithm is that CouchDB nodes do not have to talk to each other to agree on winning revisions. We already learned that the network is prone to errors and avoiding it for conflict resolution makes CouchDB very robust. Deterministic algorithm

Readme

Keywords

none

Package Sidebar

Install

npm i @prescrire/pouchdb

Weekly Downloads

0

Version

3.0.0

License

MIT

Unpacked Size

34.4 kB

Total Files

17

Last publish

Collaborators

  • jrivals
  • lichkessel