yjs/INTERNALS.md at main · yjs/yjs
This document roughly explains how Yjs works internally. There is a complete walkthrough of the Yjs codebase available as a recording: https://youtu.be/0l5XgnQ6rB4 The Yjs CRDT algorithm is described in the YATA paper from 2016. For an algorithmic view of how it works, the paper is a reasonable place to start. There are a handful of small improvements implemented in Yjs which aren't described in the paper. The most notable is that items have an originRight as well as an origin property, which improves performance when many concurrent inserts happen after the same character. At its heart, Yjs is a list CRDT. Everything is squeezed into a list in order to reuse the CRDT resolution algorithm: Each client is assigned a unique clientID property on first insert. This is a random 53-bit integer (53 bits because that fits in the javascript safe integer range). Each item in a Yjs list is made up of two objects: The item and type object pair have a 1-1 mapping. The item's content field reference
Yjs Internals This document roughly explains how Yjs works internally. There is a complete walkthrough of the Yjs codebase available as a recording: https://youtu.be/0l5XgnQ6rB4 The Yjs CRDT algorithm is described in the YATA paper from 2016. For an algorithmic view of how it works, the paper is a reasonable place to start. There are a handful of small improvements implemented in Yjs which aren't described in the paper. The most notable is that items have an originRight as well as an origin property, which improves performance when many concurrent inserts happen after the same character. At it
Explore this link on the map →related reading
- CRDTs go brrrjosephg.com
- An adventure in realtime collaborative editing — Dov Alperindov.dev
- Peritext: A CRDT for Rich-Text Collaborationinkandswitch.com
- Building a BFT JSON CRDTjzhao.xyz
- CRDT: Text Buffer - Made by Evanmadebyevan.com
- An Interactive Intro to CRDTs | jakelazaroff.comjakelazaroff.com
- NYSRGnotes.ekzhang.com
- Offline Support | Yjs Docsdocs.yjs.dev
- Data Laced with History: Causal Trees & Operational CRDTs — Archagon Was Herearchagon.net
- CRDT optimizationsbartoszsypytkowski.com
- Rhizome Research Logjzhao.xyz
- Fugue: A Basic List CRDT - Matthew Weidnermattweidner.com