Back to Problems

Design a Realtime Chat App like WhatsApp

Design a chat app like WhatsApp.

Functional requirement:

  • A user can send and receive text messages in real-time
  • Chat logs are persistent in the cloud
  • When the user gets online, she receives all the messages addressed to her during her offline time.
  • Once a message is delivered to a user, they will be store on user’s devices and we no longer need to store them on the server (like WhatsApp and WeChat).
  • The user shouldn’t see duplicate messages
  • [optional] Support group chat

Scale requirement:

  • 100M DAU
  • 20 average daily messages per user
  • Data retention for 10 years.
  • Assuming each message, with meta-data, is roughly 200 bytes.
  • Assuming that the average storage duration for messages is 4 months.

1. Resource Estimation