Chat System Design (Real-Time Messaging at Scale)

Design a real-time chat system like WhatsApp or Slack that supports one-on-one and group messaging.

Constraints

Functional

One-on-one and group chat, text/images/files, delivered and read receipts, presence, message history

Non-functional

Low latency (< 100ms), high availability, millions of concurrent users, ordered delivery, durability

Scale

500M users, 50M DAU; ~2.5B messages/day, peak ~30K/s; ~1.25 TB/day, ~2.3 PB over 5 years

Stages ahead

1Requirement Analysis
2API Design
3High-Level Design
4HLD Extensions
5Trade-offs