A production-grade collaborative editing system where multiple users can edit the same document simultaneously — no conflicts, no rollbacks, no last-write-wins hacks.
Most collaborative editors handle concurrent edits poorly — last write wins, or they require a central lock. Both break under real concurrent load. This editor solves it properly using Yjs CRDT (Conflict-free Replicated Data Type), meaning two users editing the same line at the same time always produces a correct, merged result without either losing their work.
- Frontend: React 18, WebSockets (STOMP), Material UI
- Backend: Java, Spring Boot, Spring WebFlux
- Conflict Resolution: Yjs CRDT over WebSockets
- Session Management: Redis TTL sessions
- Persistence: PostgreSQL
- Deployment: AWS (horizontally scalable, stateless architecture)
- Conflict-free concurrent editing — Yjs CRDT ensures simultaneous edits from multiple users never conflict, with no rollback required
- Live cursor presence — see where other users are editing in real time
- Autosave — Redis TTL sessions handle autosave without hammering the database
- Stateless and horizontally scalable — deployed on AWS handling 500+ concurrent sessions
- Zero data loss — split-brain scenarios handled gracefully at the CRDT layer
Operational Transformation (OT) requires a central server to serialize operations — it breaks under network partitions and is notoriously hard to implement correctly. CRDT is decentralized by design: each client maintains its own state and merges happen mathematically, not sequentially. For a system that needs to scale horizontally, CRDT was the only sensible choice.
# Clone the repo
git clone https://github.com/sainived21/realtime-collaborative-editor.git
# Start backend
cd backend
./mvnw spring-boot:run
# Start frontend
cd frontend
npm install && npm startPrerequisites: Java 17+, Node.js 18+, Redis, PostgreSQL
| Metric | Result |
|---|---|
| Concurrent sessions | 500+ |
| Conflict resolution | < 10ms |
| Autosave interval | Redis TTL based |
| Deployment | Stateless, horizontally scalable |