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

<textarea distributed>: An illustrated intro to...

Jason Orendorff
January 11, 2021
43

<textarea distributed>: An illustrated intro to CRDTs

Nodevember 2016.

[Full text of this talk](https://github.com/jorendorff/talks/blob/master/textarea-distributed/textarea-distributed.md) (much better than slides).

[Video of this talk](https://www.youtube.com/watch?v=vCkSLX7nR9Y) (still better than slides).

Jason Orendorff

January 11, 2021
Tweet

Transcript

  1. I do want to take a moment before we begin

    to ask you to participate in the spirit of the thing.
  2. This is the full state of our shared text editor.

    just a global string variable a text file is just a string
  3. I'm using a library called socket.io to handle networking between

    the browser and the server, because this talk isn't about networking. - simplest thing I could think of
  4. bit.ly/nv-univax OK, obviously this works great, but it's not perfect.

    Let's say we want to collaborate and I'm in London… speed of light
  5. …This approach is solid, but it hardcodes network latency right

    into the app. And it's at this point that I get a little frustrated. Why is this so hard?
  6. and the kids are starting to ask their mother, "Why

    is daddy so angry all the time?"
  7. if you work on web sites long enough… I picked

    text editing because it's little,…
  8. … the speed of light? It is just a fact

    of life … How do we rephrase this requirement as something possible?
  9. And at the end we'll see if I ever actually

    got my collaborative text editor working, but for now we're going to set that aside …
  10. String Number Array text number sequence of values +, slice,

    replace, etc. +, -, *, Math.sqrt(), etc. arr[i], push, sort, etc.
  11. 100% desirable… And that's all a CRDT is… example in

    a second. data type + ops over network + rules for conflicts …would solve our problem?
  12. String Now, a plain old string is not a CRDT.

    (why) But! … takes space … general pattern … add bookkeeping … not just text … history because conflicts.
  13. You can see … same things I’ve been talking about

    … … rethinking the fundamentals of programming and even of how we think about time … 14th example in this paper …