Back to projects

Cynoia

Real-time collaborative document editor supporting 50+ concurrent users with CRDT-based conflict resolution.

Full Stack Engineer|Jan 2024 - Oct 2024|Cynoia
ReactNestJSSocket.IORabbitMQRedisYJS
50+ concurrent users
40% database load reduction
< 100ms sync latency

Cynoia — Real-Time Collaborative Editor

The Problem

Teams need to collaborate on documents in real-time, but existing solutions either lack the performance for large teams or don't offer the fine-grained access control that enterprises require.

The Solution

I built a collaborative document editor using CRDTs (Conflict-Free Replicated Data Types) that supports 50+ concurrent users editing the same document with sub-100ms synchronization latency.

What I Built

CRDT-Based Real-Time Sync

Engineered the real-time collaboration layer using YJS (a CRDT implementation) with WebSocket transport via Socket.IO. Unlike Operational Transformation, CRDTs resolve conflicts automatically without a central coordinator, making the system more resilient to network partitions.

Multi-Layer Caching

Implemented a three-tier caching architecture that reduced database load by 40%:

  1. In-memory — Active document state via YJS
  2. Redis — Recently accessed documents (1-hour TTL)
  3. PostgreSQL — Persistent storage

Granular RBAC

Designed and enforced role-based access control at the document level with four permission tiers: Owner, Editor, Viewer, and Commenter. Permissions are validated on both the WebSocket connection and HTTP API layers.

Impact

  • 50+ concurrent users per document with real-time sync
  • 40% reduction in database load through caching
  • Sub-100ms synchronization latency
  • Zero data loss through CRDT conflict resolution

Tech Stack

  • Frontend: React, TypeScript
  • Backend: NestJS, Socket.IO
  • Data: YJS (CRDT), Redis, PostgreSQL
  • Messaging: RabbitMQ