...

/

Requirements of WhatsApp’s Design

Requirements of WhatsApp’s Design

Learn about the functional and non-functional requirements for a chat application like WhatsApp.

Requirements

Our design of the WhatsApp messenger should meet the following requirements.

Functional requirements

  • Conversation: The system should support one-on-one and group conversations between users.

  • Acknowledgment: The system should support message delivery acknowledgment, such as sent, delivered, and read.

  • Sharing: The system should support sharing of media files, such as images, videos, and audio.

  • Chat storage: The system must support the persistent storage of chat messages when a user is offline until the successful delivery of messages.

  • Push notifications: The system should be able to notify offline users of new messages once their status becomes online.

Note: The term “offline” typically refers to users not currently connected to the internet. When these users reconnect, the system will automatically send push notifications to alert them of any new messages. On the other hand, the term “online” indicates that the user is actively connected to the internet and can receive real-time messages.

Non-functional requirements

  • Low latency: Users should be able to receive messages with low latency.

  • Consistency: Messages should be delivered in the order they were sent. Moreover, users must see the same chat history on all of their devices.

  • Availability: The system should be highly available. However, the availability can be compromised in the interest of consistency.

  • Security: The system must be secure via end-to-end encryption. The end-to-end encryption ensures that only the two communicating parties can see the content of messages. Nobody in between, not even WhatsApp, should have access.

  • Scalability: The system should be highly scalable to support an ever-increasing number of users and messages per day.

Resource estimation

WhatsApp is the most used messaging application across the globe. According to WhatsApp, it supports more than two billion users around the world who share more than 100 billion messages each day. We need to estimate the storage capacity, bandwidth, and number of servers to support such an enormous number of users and messages.

Storage estimation

As there are more than 100 billion messages shared per day over WhatsApp, let’s estimate the storage capacity based on this figure. Assume that each message takes 100 Bytes on average. Moreover, the WhatsApp servers keep the messages only for 30 days. So, if the user doesn’t get connected to the server within these days, the messages will be permanently deleted from the server.

...

Access this course and 1400+ top-rated courses and projects.