Realtime Collaboration Workbench

A workbench artifact for exploring realtime sync, conflict handling, and offline-first tradeoffs.

Active
Started: January 15, 2024Updated: December 20, 2024Progress: 65%

Tech Stack

Next.jsTypeScriptWebSocketsPostgreSQLRedisCRDT

Thesis

This is a workbench for studying collaboration mechanics, not a finished product. The useful question is how far a small realtime system can go before conflict resolution, persistence, and offline replay become the dominant design constraints.

What It Explores

The prototype focuses on the parts that tend to decide whether collaboration feels reliable:

  • WebSocket-based sync for document events and presence
  • CRDT merge behavior for concurrent edits
  • Offline-first queues for local changes that need to replay after reconnect
  • PostgreSQL persistence for durable project state
  • Redis pub/sub for separating event fanout from storage

Current Evidence

The current artifact has enough shape to compare tradeoffs, but not enough proof to claim production readiness. The sync loop, presence model, and first conflict scenarios are in place. The next useful work is to measure where the model becomes fragile:

  • Edits made while offline and replayed out of order
  • Large documents with frequent presence updates
  • Recovery after dropped WebSocket sessions
  • Persistence behavior when reconnects happen during writes

Open Questions

The central design tension is whether a small system should lean fully into CRDT semantics or keep some server-side authority for simpler operational behavior. A hybrid approach may be easier to reason about, but it risks hiding edge cases until the system has real collaborative pressure.

The next pass is about evidence rather than scope expansion:

  1. Complete offline mode implementation
  2. Add tests for reconnect and replay scenarios
  3. Capture latency and merge behavior under larger documents
  4. Document where the prototype needs server-side coordination