CollabSheets is our answer to "what if Google Docs met VS Code met ChatGPT?"
The Challenge
Real-time collaboration is hard. Add code execution in 60+ languages, AI assistance, and you have a distributed systems nightmare.
Architecture Decisions
CRDTs vs OT We chose Operational Transformation (OT) over CRDTs for simpler conflict resolution in text editing.
WebSocket Infrastructure Using Socket.io with Redis adapter for horizontal scaling. Each room (document) is sharded across Redis pub/sub channels.
Code Execution Sandbox We use isolated Docker containers with strict resource limits. Each execution gets 512MB RAM, 30s timeout, and no network access.
AI Integration The AI assistant runs in a separate service, communicating via gRPC. It has context about the current document, cursor position, and recent edits.
Performance Metrics
- Latency: <50ms for character sync
- Concurrent users: Tested up to 100 per document
- Uptime: 99.9% over 6 months
Visit collabsheets.onrender.com to collaborate in real-time.