Sign in to confirm you’re not a bot
This helps protect our community. Learn more
Text CRDTs from scratch, in code!
81Likes
1,565Views
Feb 122025
Want to know how google docs would work, if it was decentralised and therefore better? Lets make one! In this video I implement a text CRDT (That is, a conflict-free replicating data type) for collaborative text editing, from scratch. And I explain how it all works along the way. Which CRDT? FugueMax! Which is the gold standard for text editing. And instead of doing it the tree way, like in the paper, I show how to implement it as a list - which is essential if you want to optimise the algorithm. Have a play with the working demo: https://josephg.com/fugue-demo/ Here's the code I wrote on camera: https://github.com/josephg/crdt-from-... The FugueMax paper is here: https://arxiv.org/abs/2305.00583 And here's the blog post talking about how to make this algorithm go really fast: https://josephg.com/blog/crdts-go-brrr/ Part 2 is here:    • Lets write Eg-walker from scratch! Pa...   00:00:00 Intro 00:05:01 How do CRDTs work? 00:13:12 Project setup 00:19:11 Add items 00:34:04 Understanding integrate 00:40:41 Testing 00:45:05 Document versions 00:50:57 Merging documents 00:59:16 Testing 01:02:56 Deletion 01:10:22 Moer tests 01:12:47 Editor 01:21:58 It works! 01:25:36 recap & end

Follow along using the transcript.

Joseph Gentle

352 subscribers