Real-world Systems
12 min forge
Chat System Design
Designing a real-time messaging application like WhatsApp or Slack.
π¬ Chat System Design
1. Requirements
- Real-time messaging (1:1 and Group)
- Online/Offline status
- Message persistence
2. Protocol
- WebSockets for real-time bidirectional communication.
3. Storage
- SQL for user data.
- Cassandra for chat history (high write throughput).
4. Components
- Chat Service: Manages WS connections.
- Presence Service: Tracks status in Redis.
- Push Notifications: For offline users.