WhatsApp Architecture
Billions of messages a day with a famously small engineering team.
On the roadmap:Software Architect · step 5: Learn from the giants
Overview
WhatsApp relies on Erlang's lightweight processes to hold millions of persistent connections per server, with a store-and-forward model for message delivery.
Architecture highlights
- Erlang/BEAM for massive concurrency
- Persistent connections over a custom XMPP-derived protocol
- Store-and-forward delivery with acknowledgements
- End-to-end encryption using the Signal protocol
Architecture diagram
Key components
Chat servers
Hold long-lived client connections
Message queue / store
Holds messages for offline recipients
Presence service
Tracks online status and delivery receipts
Media storage + CDN
Stores and serves images, video and voice notes
Challenges and trade-offs
Connection density
Millions of sockets per host need cheap per-connection memory.
Offline delivery
Messages must be persisted until the recipient reconnects.
Encryption at scale
Key exchange and group fan-out must remain fast.
Study: WhatsApp
Learn how WhatsApp is built from the people who explain it. Watch first for the picture, then read for the detail.
25 minWHATSAPP System Design: Chat Messaging Systems for Interviews
Gaurav Sen · 2.1M views
Then
10 minHow Signal Instant Messaging Protocol Works (& WhatsApp etc) - ComputerphileComputerphile · 536K views
21 minSystem Design: Messenger service like Whatsapp or WeChat - Interview QuestionSuccess in Tech · 359K views
58 minDesign Whatsapp: System Design Interview w/ a Ex-Meta Senior ManagerHello Interview · 345K views
28 minWhatsapp System design or software architectureTech Dummies - Narendra Lakshmana Gowda · 266K views