WhatsApp's system design

0/4
☰
WhatsApp · 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

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.

3B+
monthly users (2025)[14]
~100B
messages a day (2020)[13]
1B+
calls a day (2024)[22]

In this lesson

4 chapters · ~9 min · a quick check in each

Everything is on this page — just scroll down ↓

Chapter 1 of 4

The whole system

1
Requirements

What it must do — and how well

Yellow notes are what WhatsApp must do; blue ones are how well. Two shape everything: deliver to phones that are off, and keep the servers unable to read what they carry.

ⓘ Details & sources

Yellow = what the system must do. Blue = how well it must do it.[10][18][22]

Send a text, photoor voice note to aperson or a group.Deliver to phonesthat are off, assoon as they'reback.Tell the sender:sent, delivered,read.Voice and videocalls, one-to-one orin a group.One account: a phone+ up to 4 linkeddevices (2021).Real time: arriveswhile you're stilllooking.Never lose amessage; neverdeliver one twice.Private: serverscan't read chats orcalls.Work on slow, flakymobile networks.Run with a tinyteam.
2
Architecture

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.

ⓘ Details & sources

Click any piece to see what it does and why. Play a flow to follow a message through the system.[3][10]

Watch it happen:
WhatsApp's servers11pushed instantly2phone off344wake up4upload file5download5Your phoneone open linePresenceonline · last seenmodelLoad balancerpicks a servermodelChat serversErlang · ~1M phones eachMedia blob storeencrypted filesOffline mailboxkept until deliveredPush servicewakes the phoneApple / Googlepush networksFriend's phonedecrypts
clientload balancerserviceworkerdatabasestorageexternal dashed border = simplified model
12345
Step 1 of 5

Your phone keeps one connection open to a chat server — the heart of WhatsApp, written in Erlang.

Curious? Go deeper+ 1 optional
3
Sequence

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.

ⓘ Details & sources

Your phone number is your account; your address book is how you find people.[25][10][8]

Your phoneWhatsApp servers1. My phone numberWhatsApp serversSMS or phone call2. Send a 6-digit codeSMS or phone callYour phone3. Your codeYour phoneWhatsApp servers4. The code, then my PUBLIC keysYour phoneWhatsApp servers5. Log in with my own key pairYour phoneWhatsApp servers6. Contact upload: my address bookWhatsApp serversYour phone7. Who of them is on WhatsApp

7 steps. Follow the flow one step at a time — what happens first, and what comes next.

Quick check

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.

  1. 2Messages
  2. 3Encryption
  3. 4Growth & failures
Questions & comments

Ask anything about this system, or share how you'd design it.

Log in to join the conversation