Cynoia
Real-time collaborative document editor supporting 50+ concurrent users with CRDT-based conflict resolution.
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%:
- In-memory — Active document state via YJS
- Redis — Recently accessed documents (1-hour TTL)
- 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