Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CRDT 101

CRDT 101

A8d8ca813a744866b9f85ea1cefb5813?s=128

Sergey Arkhipov

December 09, 2014
Tweet

Transcript

  1. CRDT 101 Архипов Сергей @9seconds 10.12.2014

  2. Наши проблемы ← CRDT ― Network ― RAM ― Persistent

    storage ― CPU
  3. 90е ← CRDT Web Server Application Database

  4. 90е ← CRDT Web Server Application Database

  5. 2000: Load Balancing ← CRDT

  6. 2000: Load Balancing ← CRDT

  7. 2002: Replication ← CRDT

  8. 2004: Caching ← CRDT

  9. 2004: Caching ← CRDT

  10. 2006: Web 2.0 + Amazon = Sharding ← CRDT

  11. 2008: NoSQL ← CRDT

  12. 2010: MapReduce ← CRDT

  13. 2000: CAP ← CRDT ― Consistency ― Availability ― Partition

    Tolerance
  14. 2009: CRDT ← CRDT

  15. 2009: CRDT ← CRDT

  16. 2009: CRDT ← CRDT

  17. 2009: CRDT ← CRDT

  18. 2009: CRDT ← CRDT

  19. 2009: CRDT ← CRDT

  20. 2009: CRDT ← CRDT CmRDT — Commutative Replicated Data Type

    Assuming causal delivery of updates and method termination, any op-based object that satisfies the commutativity property for all concurrent updates, and whose delivery precondition is satisfied by causal delivery, is strong eventual consistent.
  21. LWW-element-Set ← CRDT

  22. LWW-element-Set ← CRDT tweet = { id: "3b6730f1-50c7-4fad-ac47-ba8c2efadfc1", timestamp: 1416757099,

    user: "9seconds" message: "Test message" } def tweet_to_lww(tweet): return tweet["timestamp"], tweet
  23. LWW-element-Set ← CRDT A R A R

  24. LWW-element-Set ← CRDT A R A R (t1, a)

  25. LWW-element-Set ← CRDT A R A R (t1, a) (t1,

    a)
  26. LWW-element-Set ← CRDT A R A R (t2, b) (t1,

    a) (t1, a)
  27. LWW-element-Set ← CRDT A R A R (t1, a) (t1,

    a) (t2, b)
  28. LWW-element-Set ← CRDT A R A R (t3, c) (t1,

    a) (t1, a) (t2, b)
  29. LWW-element-Set ← CRDT A R A R (t1, a) (t1,

    a) (t2, b) (t3, c) (t2, b) (t2, b) (t4, c)
  30. LWW-element-Set ← CRDT A R A R (t1, a) (t1,

    a) (t2, b) (t3, c) (t2, b) (t2, b) (t4, c) (t4, c)
  31. LWW-element-Set ← CRDT A R A R (t1, a) (t1,

    a) (t2, b) (t3, c) (t2, b) (t2, b) (t4, c) (t4, c) Synchronizer (SoundCloud Roshi)
  32. LWW-element-Set ← CRDT A R (t1, a) (t1, a) (t3,

    c) (t2, b) (t2, b) (t4, c) (t4, c)
  33. LWW-element-Set ← CRDT A R (t1, a) (t3, c) (t2,

    b) (t4, c)
  34. LWW-element-Set ← CRDT (t1, a) (t2, b)

  35. LWW-element-Set ← CRDT A R A R (t1, a) (t1,

    a) (t2, b) (t3, c) (t2, b) (t4, c) (t4, c) Synchronizer (SoundCloud Roshi) (t3, c)
  36. Many CRDTs! ← CRDT ― Op-based Counter ― G-Counter ―

    State-based PN Counter ― LWW-Register ― MV-Register ― G-Set ― 2P-Set ― LWW-element-Set ― PN-Set ― OR Set ― Add-only monotonic DAG ― Add-Remove Partial Order data type ― RGA ― RHA ― TreeDoc ― Logoot ― WOOT ― WOOTH
  37. (Not) Many implementations ← CRDT ― Apache Cassandra ― Apache

    HBase ― Basho Riak ― SoundCloud Roshi ― Akka CRDT
  38. Q/A ← CRDT @9seconds    https://speakerdeck.com/9seconds/crdt-101