CRDTs (Conflict-Free Replicated Data Types)

Widely used in Google Docs or Figma or Redis to achieve eventually consistent model. The rules are

  1. Commutative: Order of the application doesn't matter
  2. Associative: Grouping of the operations doesn't matter
  3. Idempotent: Applying exact same thing multiple time does not change the effect

There are 2 types of CRDTs

  1. State-based CRDTs (CvRDTs): transmit the entire local state of data structure to other replica. However, this need a built-in merge function to combine its data with incoming data. Tolerate loss well consume lots of bandwidth
  2. Operation-based CRDTs (CmRDTs): broadcast specific operations (add 5, minus 5)