Skip to main content
Back to Blog
Trends & Insights
2 min read
March 8, 2025

Real-Time Collaboration Infrastructure: Building Google Docs-Level Multiplayer Features

Users expect real-time collaboration in every app. CRDTs, operational transforms, and managed services make multiplayer features achievable for small teams.

Ryel Banfield

Founder & Lead Developer

Google Docs changed user expectations. Now everyone expects to see cursors, edits, and updates in real time. Figma, Notion, Linear, and countless other tools deliver multiplayer experiences. Building these features used to require a team of infrastructure engineers. In 2026, managed services and mature libraries make it accessible.

Core Concepts

Operational Transformation (OT)

The algorithm Google Docs uses. When two users edit simultaneously, OT transforms operations to maintain consistency.

  • Pros: Battle-tested, well-understood
  • Cons: Complex to implement, requires a central server

CRDTs (Conflict-Free Replicated Data Types)

Data structures that can be merged without conflicts. Each client can edit independently, and changes merge automatically.

  • Pros: Works offline, no central server needed, mathematically guaranteed consistency
  • Cons: Higher memory overhead, some data types are complex

WebSockets

The transport layer for real-time communication. Maintains a persistent connection between client and server.

WebRTC

Peer-to-peer communication for direct client connections. Good for video/audio and some collaboration scenarios.

Managed Services

ServiceApproachBest ForPricing
LiveblocksCRDT-based, React hooksDocument collaborationFree tier + $25/month
PartyKit (Cloudflare)Durable Objects, WebSocketsCustom real-time logicFree tier + usage-based
AblyPub/sub messagingEvent broadcastingFree tier + usage-based
PusherChannel-based real-timeSimple presence and eventsFree tier + usage-based
ConvexReal-time databaseFull-stack real-time appsFree tier + usage-based
Supabase RealtimePostgres changes broadcastDatabase-driven updatesIncluded with Supabase

CRDT Libraries

Yjs

The most popular JavaScript CRDT library. Powers many collaborative editors.

import * as Y from 'yjs';
import { WebsocketProvider } from 'y-websocket';

// Create a shared document
const ydoc = new Y.Doc();
const provider = new WebsocketProvider('wss://your-server.com', 'room-id', ydoc);

// Get a shared data type
const ytext = ydoc.getText('editor');

// Changes automatically sync across all connected clients
ytext.insert(0, 'Hello, everyone!');

Automerge

A CRDT library focused on JSON-like documents. Great for structured data collaboration.

import * as Automerge from '@automerge/automerge';

let doc = Automerge.init();
doc = Automerge.change(doc, (d) => {
  d.tasks = [];
  d.tasks.push({ title: 'New task', done: false });
});

Loro

A newer CRDT library with better performance characteristics and support for rich text, trees, and lists.

Common Collaboration Features

Presence

Show who is online and where they are in the document.

// Using Liveblocks
const others = useOthers();
const updateMyPresence = useUpdateMyPresence();

// Share cursor position
updateMyPresence({ cursor: { x: 100, y: 200 } });

// Show other users' cursors
others.map((user) => (
  <Cursor key={user.connectionId} position={user.presence.cursor} />
));

Live Cursors

Show each user's cursor position in real time. Requires low-latency updates.

Collaborative Editing

Multiple users editing the same text, form, or canvas simultaneously.

Comments and Threads

Real-time discussion threads anchored to specific content.

Notifications

Alert users to changes relevant to them.

Undo/Redo

Each user has their own undo stack, independent of other users' changes.

Architecture Patterns

Client-Server (OT)

Client A ──→ Server ──→ Client B
Client B ──→ Server ──→ Client A

Server maintains authoritative state. All operations go through the server.

Peer-to-Peer (CRDTs)

Client A ←──→ Client B
Client A ←──→ Client C
Client B ←──→ Client C

No central server needed (though one is often used for persistence and discovery).

Hybrid

CRDTs for conflict resolution, server for persistence, authorization, and initial state loading.

When to Add Real-Time Features

High value:

  • Document editors and wikis
  • Design tools
  • Project management boards
  • Spreadsheets and data tables
  • Whiteboarding tools

Medium value:

  • Dashboards and analytics
  • Form builders
  • Content management systems

Low value (usually not worth the complexity):

  • Marketing websites
  • E-commerce product pages
  • Blog platforms

Our Implementation Approach

We evaluate real-time requirements carefully. For projects that need collaboration features, we use Liveblocks or Yjs depending on the use case. For simpler real-time needs like live updates, Supabase Realtime or Convex provide the right level of functionality without overengineering.

real-time collaborationmultiplayerCRDTswebsocketstrends

Ready to Start Your Project?

RCB Software builds world-class websites and applications for businesses worldwide.

Get in Touch

Related Articles