Document systems are easy until:
- Multiple users edit at the same time
- Reads outnumber writes 100:1
- Real-time updates are expected
- You need to scale without breaking consistency
This project explores how to handle those problems incrementally, starting with WebSockets + Redis, and evolving toward Kafka-based event streaming.
- Django for REST + WebSocket APIs
- WebSockets for real-time collaboration
- Redis for caching, pub/sub, and distributed locks
- PostgreSQL for persistent storage
- Docker & Docker Compose for containerized services
- AWS (selected services) for deployment & infrastructure
- ✅ REST APIs with DRF
- ✅ WebSocket-based real-time document updates
- ✅ JWT-based authentication
- ✅ Redis caching (read-heavy optimization)
- ✅ Redis Pub/Sub for WebSocket fan-out
- ✅ Distributed locking for concurrent edits
- ✅ Rate limiting for write operations
- ✅ Dockerized services for local & cloud deployment
- Client connects via WebSocket
- Document edits are validated and locked using Redis
- Updates are persisted to PostgreSQL
- Changes are broadcast using Redis Pub/Sub
- Connected clients receive updates in real time
- EC2 / ECS — containerized service deployment
- RDS (PostgreSQL) — managed relational database
- ElastiCache (Redis) — caching & pub/sub
- S3 (optional) — document attachments / assets
Infrastructure choices are modular and can be extended or discarded without major refactoring.
Kafka is planned for:
- Activity logging
- Notifications
- Audit trails
- Analytics
- Decoupling side-effects from request flow
WebSockets + Redis → Kafka (event backbone)
| Category | Technology |
|---|---|
| Backend | DRF |
| Real-Time | WebSockets |
| Database | PostgreSQL |
| Cache / Locks | Redis |
| Containers | Docker |
| Cloud | AWS |
python manage.py runserver