Back to blog
Ai News

Collaborative Editing Crdt

5 min read

Real-time collaborative editing — the kind where multiple people can type into the same document simultaneously and never see a conflicting mess — used to require complex, custom-built conflict resolution logic. In 2026, CRDTs (Conflict-free Replicated Data Types) have become the standard, well-understood approach, and the tooling around them has matured enough that building this feature no longer requires reinventing the underlying algorithm.

What a CRDT actually does

CRDTs are data structures purpose-built for distributed systems where multiple users edit the same data concurrently. The core guarantee is convergence: each client maintains its own copy of the document, and when a change occurs, only the change itself (not the whole document) is sent to other clients. No matter what order those changes arrive in, or how much they overlap in time, the math behind a CRDT guarantees all clients eventually converge to the same final state — without needing a central server to arbitrate every single edit in real time.

This is a meaningfully different approach from older techniques like Operational Transformation (OT), which requires more careful server-side coordination to resolve conflicting edits. CRDTs push more of that resolution logic into the data structure itself, which tends to make the system easier to reason about and more resilient to network interruptions — a client can go offline, keep editing locally, and merge back in cleanly once reconnected.

Yjs is the library most teams reach for

Yjs has emerged as the dominant CRDT implementation for web-based collaborative editing. It provides shared data types (text, arrays, maps) that automatically handle conflict resolution under the hood, meaning application developers work with familiar data structures rather than implementing CRDT algorithms from scratch. This is the biggest practical shift over the past few years — CRDTs went from an academic/research topic to something you can npm install and build on top of.

The infrastructure pattern that's emerging

A pattern gaining traction in 2026 combines Yjs with edge compute infrastructure — for example, pairing Yjs with Cloudflare Durable Objects, which gives each collaborative document its own stateful, geographically-distributed compute instance that coordinates connected clients. This combination handles a problem that used to require significant custom infrastructure: keeping a lightweight, low-latency coordination point close to users, without needing to run and scale a traditional stateful server fleet yourself.

Notably, Liveblocks open-sourced its sync engine in February 2026 under AGPL v3, though it's currently scoped for local development and testing rather than production self-hosting — a sign of the broader trend toward making collaborative-editing infrastructure more accessible, even if the fully production-ready self-hosted options are still catching up.

The algorithm landscape has kept evolving

The underlying algorithms behind real-time collaboration have moved through several generations: from the classic Operational Transformation approach, to RGA (Replicated Growable Array, a CRDT-family algorithm), and more recently to newer approaches like EG-Walker, which aim to improve on earlier CRDT algorithms' performance and memory characteristics for large, long-lived documents. If you're evaluating a library, it's worth understanding which algorithmic generation it's built on, since older implementations can carry meaningfully worse performance characteristics on large documents with long edit histories.

Practical guidance for building this feature

  • Don't build CRDT logic from scratch — Yjs (or a similarly mature library) has already solved the hard conflict-resolution problem; the value-add for most products is in the application layer on top, not the sync engine itself.
  • Pair your CRDT library with infrastructure that keeps coordination close to users geographically — latency in the sync layer is what makes collaborative editing feel "real-time" or feel laggy, and it's largely an infrastructure decision, not a CRDT algorithm decision.
  • Design explicitly for offline-then-reconnect scenarios — one of CRDTs' real strengths is handling a client that edits offline for a while and merges back cleanly, so it's worth testing that path deliberately rather than assuming it works because the underlying algorithm theoretically supports it.

Real-time collaborative editing has gone from "hard, custom infrastructure problem" to "well-understood pattern with mature open-source tooling" over the past few years — the remaining work for most teams is in the application experience built on top, not the underlying sync mechanics.

Real production performance numbers, and the local-first movement this connects to

Beyond the algorithmic evolution described above, it's worth knowing what current CRDT implementations actually achieve in production terms, since "mature tooling" is a vague claim without numbers behind it. Automerge, one of the two most widely used CRDT libraries alongside Yjs, has reported processing 260,000 keystrokes in around 600ms in recent benchmarks — a dramatic improvement over earlier CRDT implementations that struggled with performance on large, long-lived documents. Yjs, for its part, is commonly benchmarked handling somewhere between 26,000 and 156,000 operations per second depending on workload characteristics. These aren't small optimizations — they're the difference between "CRDTs work in a demo" and "CRDTs work at the scale of a real production document editor with years of edit history," which is a large part of why adoption has accelerated the way it has.

This performance maturity is also part of a broader architectural movement worth naming: local-first software, where application data lives primarily on the user's own device and syncs to the cloud as a secondary concern rather than the cloud being the primary source of truth the app depends on to function at all. Figma is a well-known example — it switched from Operational Transformation to CRDTs specifically to support offline-first collaborative editing, and Linear has built much of its famously fast, offline-resilient interface on similar local-first principles. The ecosystem infrastructure around this pattern has matured alongside the CRDT libraries themselves: tools like PowerSync and ElectricSQL, which sync a subset of server data down to a local SQLite database on the client, have become genuinely production-ready options for teams building on existing Postgres, MongoDB, or MySQL databases rather than needing to adopt a CRDT-native database from scratch. The practical implication for teams evaluating this space in 2026: the collaborative-editing feature described in this piece is really one instance of a broader "local-first" architectural pattern, and the same infrastructure choices (Yjs plus edge compute, or PowerSync/ElectricSQL for syncing a subset of relational data) increasingly apply beyond just document editing to any feature that benefits from working reliably offline and syncing cleanly on reconnect.

Sources: Velt — Best CRDT Libraries Updated 2026, Medium — Building a Real-Time Collaborative Editor with CRDT and Durable Objects, OneUptime — Real-Time Collaborative Editing in Node.js, DEV Community — Local-First Software Is Winning, AppScale — Local-First Architecture: CRDTs & Sync Engines

Keep reading

Get new posts as they publish

No spam — just the next post, straight to your inbox.

Discussion