WhatsApp System Design

How WhatsApp delivers billions of messages a day: persistent WebSocket connections, a message queue for offline users, media storage behind a CDN, and end-to-end encryption. A classic system design interview question.

WhatsApp System Design — System design poster

How it flows

  1. Mobile Client → DNS
  2. DNS → Load Balancer
  3. Load Balancer → WebSocket Server
  4. Load Balancer → Auth Service (Authenticate)
  5. WebSocket Server → Chat Service
  6. Chat Service → E2E Encryption
  7. Chat Service → Group Service
  8. Chat Service → Message Queue (Enqueue)
  9. Message Queue → Message Store
  10. Message Queue → Offline Queue
  11. Offline Queue → Push Notification (Offline Push)
  12. Mobile Client → Media Upload
  13. Media Upload → Media Encoder
  14. Media Encoder → Media Storage
  15. Media Storage → CDN
  16. CDN → Mobile Client
  17. WebSocket Server → Monitoring
  18. Message Store → WebSocket Server

Components

Group Service · WebSocket Server · Chat Service · Message Queue · Media Upload · Media Encoder · Media Storage · Message Store · Offline Queue · Auth Service · E2E Encryption · Mobile Client · DNS · Load Balancer · CDN · Push Notification · Monitoring

← All designs

Try AI Flowchart free →