crdt.txt (922B)
1 CRDT 2 3 https://www.bartoszsypytkowski.com/the-state-of-a-state-based-crdts/ 4 5 We can discrimitate CRDTs using two core categories: state-based (convergent) and operation-based (commutative) data types. No matter which one we talk about, they all consists of two parts: replication protocol and state application algorithms. 6 7 - Replication Protocol 8 - State Application Algorithms 9 10 Merge operation must conform to three properties: 11 12 1. Commutativity (x . y = y . x) 13 14 2. and Asociativity ((x . y) . z = x . (y . z)) which means that 15 we can perform out of order merge operations and still end up 16 with correct state 17 18 3. Idempotency (x . x = x), so we don't need to care about potential 19 duplicates send from replication layer 20 21 Those properties are not easy to guarantee, but you're going to see how far we can go only by using two basic operations, which meet those criteria: 22 23 - union of two sets 24 - maximum of two values