Case 02
Real-Time Collaborative Workspace
Presence, sync, and shared state across instances

Overview
A real-time platform where multiple people can work on documents and projects at once — with live updates, presence, comments, and a shared workspace.
Problem
Request-response APIs are a poor fit for simultaneous collaboration. Keeping many clients consistent, especially across more than one server instance, is the actual engineering problem.
Architecture
Architecture · 02
- 01
Authenticated clients
- 02
WebSocket gateway
- 03
Redis pub/sub
- 04
Optimistic UI
- 05
PostgreSQL persistence
- 06
Reconnection + presence
A WebSocket architecture carries live communication. Redis coordinates events across instances. PostgreSQL holds durable application data. The system includes authentication, workspace permissions, presence, optimistic updates, reconnection, and a path to horizontal scale.
Engineering
The hard surface is consistency: concurrent edits, dropped sockets, and the gap between ephemeral real-time state and what must survive in the database.
Challenges
- Concurrent updates without silent conflict
- Connection lifecycle and reconnection
- Cross-instance synchronization via Redis pub/sub
- Optimistic interface updates
- Keeping live state aligned with durable data