eli5: how does CRDT protocol work

52 viewsOtherTechnology

eli5: how does CRDT protocol work

In: Technology

Anonymous 0 Comments

Picture that you are back in high school, where gossiping is the craze. Then, imagine that Elon Musk’s son, X Æ A-12, is in the same school.

>You hear gossips left and right. One morning, you hear from one friend, “Yo, I heard X has 5 Teslas in his bedroom”. Shortly after, you hear from another. “Yo, I heard X has 3 Teslas in his bedroom”.

Now you are confused. Did he sell 2 Teslas? Perhaps the other friend is late, and he actually bought 2 more?

Then picture this alternate scenario:

>You hear gossips left and right. One morning, you hear from one friend, “Yo, I heard Elon gave him 3 Teslas”. Shortly after, you hear from another. “Yo, I heard Elon gave him 2 Teslas.”

This time, it clicked. Because, regardless of which gossip comes first, there is no confusion that X has 5 Teslas now.

This is the gist of CRDT protocols. It all boils down to ensuring that A + B = B + A, or the commutative property. Gossip 1 + Gossip 2 = Gossip 2 + Gossip 1.