Designing a Real-Time Chat System
Walk through the system design of a real-time chat application, covering connections, message delivery, storage, and scaling.
The Problem
Design a chat system like WhatsApp or Slack: users send messages that appear on recipients' devices instantly, with history, online presence, and delivery receipts — at the scale of millions of concurrent users.
Requirements
Clarify scope first:
- Functional: 1:1 and group chat, message history, presence, delivery/read receipts
- Non-functional: low latency, high availability, ordered delivery, horizontal scale
All lessons in this course
- Designing a URL Shortener
- Building a Social Media Feed
- Scaling an E-commerce Platform
- Designing a Real-Time Chat System