WhatsApp's system design
☰
WhatsApp is a post office for phones: one open line while the app runs, a mailbox for phones that are asleep or off, and end-to-end encryption so the post office can't read the mail.
+ The whole system in one paragraph− Hide
While the app runs, your phone keeps one open line to a chat server. The server pushes each message down that line, or keeps it in a mailbox until the phone is back, then deletes it. On top sits end-to-end encryption: the phones agree on keys the server never sees, so it carries mail it can't read.
In this lesson
4 chapters · ~9 min · a quick check in eachEverything is on this page — just scroll down ↓
The whole system
What it must do — and how well
WhatsApp, on one page
While the app runs, your phone keeps one open line to a chat server (in Erlang, built for phone switches). It pushes each message at once, or parks it in a mailbox until the app is back.
Your phone keeps one connection open to a chat server — the heart of WhatsApp, written in Erlang.
Curious? Go deeper+ 1 optional
Sign up and find your friends
How a phone joins. Your number is your account, proven with a 6-digit code; the phone registers only PUBLIC keys. Your address book shows who you can reach; how contacts are matched isn't published.
7 steps. Follow the flow one step at a time — what happens first, and what comes next.
In 2014 about 147M phones were connected at once, ~1M per chat server. About how many chat servers is that?
Pick one — or just keep scrolling, it's not graded.
Keep going — it's free
Create your free account to unlock the rest of WhatsApp's system design, keep your progress and pick up right where you left off.
- 2Messages
- 3Encryption
- 4Growth & failures
Ask anything about this system, or share how you'd design it.
Log in to join the conversation