Yjs - Collaborative Editing CRDT

Open-source CRDT Library Y Applications & Practices

Basic Information

Product Description

Yjs is a high-performance shared data type library for building collaborative software. It is currently the fastest CRDT implementation, boasting a vast ecosystem of editor integrations and communication/storage adapters. Yjs is widely used in applications requiring real-time collaborative editing, from document editors to whiteboard tools.

Core Features/Characteristics

  • Extreme Performance: Fastest among all CRDT libraries
  • Shared Data Types: Y.Map, Y.Array, Y.Text, Y.XmlFragment, etc.
  • Rich Editor Bindings: Supports many mainstream editors
  • Modular Architecture: Communication protocols, editor integrations, and storage drivers can be independently replaced
  • Offline Support: Fully supports offline work, automatically syncs upon reconnection
  • Awareness Protocol: Shares user states (cursor position, online status, etc.)
  • Subdocuments: Supports incremental loading of large documents
  • Cross-Language: Rust port (y-crdt) supports multi-language bindings

Editor Integrations

  • ProseMirror/Tiptap: y-prosemirror
  • Monaco (VS Code Editor): y-monaco
  • CodeMirror: y-codemirror.next
  • Quill: y-quill
  • Slate.js: slate-yjs
  • BlockSuite: Built-in Yjs support
  • Lexical (Meta): @lexical/yjs

Communication Adapters

  • y-websocket: WebSocket synchronization
  • y-webrtc: WebRTC P2P synchronization
  • y-dat: Dat protocol
  • Hocuspocus: Full-featured WebSocket backend

Storage Adapters

  • y-indexeddb: Browser IndexedDB storage
  • y-leveldb: LevelDB storage
  • y-redis: Redis storage

Technical Architecture

  • CRDT Algorithm: YATA (Yet Another Transformation Approach)
  • Encoding: Efficient binary encoding format
  • Incremental Updates: Transmits only changes, not the full document state
  • Individual Counters: Uses monotonically increasing counters for each node

Business Model

  • Yjs core is completely free and open-source (MIT)
  • Kevin Jahns earns income through GitHub Sponsors and consulting
  • Some components in the ecosystem have commercial versions

Comparison with Automerge

  • Yjs is significantly faster in text editing scenarios
  • Yjs has a richer ecosystem (more editor integrations and adapters)
  • Automerge's data model is more general (JSON-like)
  • Automerge has better cross-language support (Rust core)
  • Choice: Yjs for text-intensive applications, Automerge for general data synchronization

Major Users

  • Notion (uses Yjs principles for collaborative editing)
  • Liveblocks (uses Yjs for collaborative infrastructure)
  • Numerous open-source collaborative editors
  • Enterprise internal collaboration tools

Relationship with OpenClaw

If OpenClaw needs to implement collaborative features (such as multi-user management of AI agents or shared conversations), Yjs is the best choice for collaborative editing CRDT.

Sources

External References

Learn more from these authoritative sources: