WebSockets are the easy part: what I learned deep-diving into CRDTs and Yjs
30 May 2026 · 4 min read · first published on LinkedIn
For the last few days, I've been deep-diving into CRDTs (Conflict-free Replicated Data Types), Yjs, and real-time collaborative systems.
I started with what seemed like a simple question:
"How do apps like Figma, Notion, Google Docs, or multiplayer editors allow multiple people to edit the same document at the same time without things breaking?"
I assumed the answer would be WebSockets.
Turns out WebSockets are the easy part.
The hard part is making sure every user eventually sees the exact same state, even when:
- Multiple users edit simultaneously
- Users go offline and continue editing
- Updates arrive out of order
- Network connections drop and reconnect
That led me down the rabbit hole of Operational Transforms (OT) and CRDTs.
One insight that completely changed my understanding
OT and CRDTs solve the same problem, but from very different angles.
OT says: Keep the data simple and make the transformation logic smart.
CRDT says: Make the data structure smart so the merge logic becomes simple.
A line that stuck with me:
OT is "smart functions over dumb data."
CRDT is "dumb merge over smart data."
The challenge isn't handling one edit.
The challenge is ensuring every device in the world independently reaches the exact same final result without needing a human to resolve conflicts.
That's where CRDTs become fascinating.
What surprised me about Yjs
I chose Yjs because it's one of the most widely used and battle-tested CRDT implementations, and it exposes many of the real-world concepts that collaborative systems need.
A few things I learned:
- Every edit gets a globally unique identity.
- Deletes don't immediately remove data—they become "tombstones."
- Offline edits are first-class citizens, not edge cases.
- The server doesn't need to understand document semantics.
- Presence (cursors, who's online, selections, etc.) is a completely separate concern from document state.
One mental model I found useful:
The Yjs server is mostly a "dumb pipe with memory."
Most of the intelligence lives in the clients.
Fun experiment anyone can try
- Open the same Yjs document in two tabs.
- Disconnect both tabs from the network.
- Make different edits in each tab.
- Reconnect.
Watching both tabs converge to the same state automatically is one of those moments where distributed systems suddenly become tangible.

Things I ended up learning along the way
- CRDTs vs Operational Transforms
- Why Google Docs historically used OT
- How Figma approached multiplayer collaboration
- YATA (the algorithm behind Yjs)
- State vectors and synchronization protocols
- Awareness protocols (cursors, online users)
- WebSockets vs WebRTC
- Offline-first architecture
The next step for me is building something on top of these ideas instead of just reading about them.
If you've worked with CRDTs, local-first software, Yjs, Automerge, or collaborative systems, I'd love to hear what projects taught you the most.
Resources that helped me understand CRDTs better
Comments and corrections are open on the original post.