Skip to content

Instantly share code, notes, and snippets.

@freshtonic
Created August 6, 2016 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save freshtonic/6e607be90fb2a45e0c20c6b5511dc2d7 to your computer and use it in GitHub Desktop.
Save freshtonic/6e607be90fb2a45e0c20c6b5511dc2d7 to your computer and use it in GitHub Desktop.
CRDT learning resources
This preso made CRDTs really click for me
- http://richard.dallaway.com/crdt/
But only after reading this paper which describes a CRDT imlemented as a tree of edits.
- https://hal.inria.fr/file/index/docid/445975/filename/icdcs09-treedoc.pdf
Grokking how conflict resolution is determined is key I think. The CRDT will hold every party's
edits; but only one of them "wins" in the case of a conflict. Essentially it comes down to a having a deterministic way
of everyone agreeing who wins and the simplest way to do that is to treat the edits themselves as a value with a sort
order. The sort order would operate on some unique key generated for each participant. When two edits conflict they are
sorted and a winner is determined.
Ultimately a CRDT is a data type that has a combine operation that is commutative.
So edit1 + edit2 === edit2 + edit
No matter what the order, the result is the same. For this to happen there must be precendence rules for dealing with
conflicts.
The edits themselves *are* the CRDT as is the result of combining edits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment