May 10, 2026 · 12 min read

Why We Built Our Own CRDT Engine

Everyone asks why we didn't just use Yjs. Here's the actual answer (it's not because we're hipsters who love reinventing wheels).

The Problem With Off-the-Shelf CRDTs

When we started, we tried Yjs. It's great — seriously, it's the best CRDT library out there for text. But it's designed for "text as a flat string". Code isn't a flat string. If two people are editing inside different functions and the CRDT merges them incorrectly, you get invalid syntax and everything breaks.

Automerge is similar — good for text, not great for structured content like code. And both have memory overhead that gets noticeable when you've got a 50,000-line file open (which, yes, some people have). If you're curious how Automerge works, their docs are surprisingly readable.

What We Actually Built

Two things that make ours different:

Fractional indexing for positions. Instead of "character 5", we use positions like 0.5, 0.25, 0.75 — basically, we can always insert between any two positions without renumbering everything. It's math from the 1800s (seriously, it's called "density topology" or something), and it works really well for collaborative editing.

RGA for the sequence. Replicated Growable Array. Each character knows its parent. When updates arrive out of order (because internet), we can still place them correctly. Google Docs uses a similar approach — we're not claiming to be geniuses, we just implemented it for code specifically.

The Numbers (Which Matter)

After rolling this out:

Should You Do This?

No. Unless you're building a collaborative editor and have very specific performance requirements, just use Yjs. It's battle-tested, has a community, and you won't waste 8 months like we did.

We only did it because: (a) we're opinionated about latency, and (b) we wanted to understand exactly how the merge logic works so we can debug it when things go wrong (they did, several times).

What's Next

Two things we're still fixing:

Binary files. Right now we only handle text. If you want to collaborate on an image or a PDF, we don't support it. Adding that.

Offline-first. If your internet dies, we save locally and sync when you're back. Works, but has edge cases we're still finding.


If you're curious about the technical details, we'll be publishing more posts about the CRDT internals. Follow the blog or email us if you want to argue about CRDT designs.