Design WhatsApp

Design a messaging app supporting one-to-one and group chats with delivery and read receipts.

Real-time chat · Medium

Functional requirements

  • Send and receive messages in real time
  • Group chats up to 500 members
  • Sent, delivered and read receipts
  • Messages arrive when an offline user reconnects

Scale & non-functional requirements

  • 2B users, 100B messages per day
  • Message delivery under 1 second
  • No message loss or duplication

Hints

  • How do clients keep a live connection (WebSockets)?
  • How do you route a message to the server holding the recipient's connection?
  • Where are undelivered messages kept?

More system design questions

Try AI Flowchart free →