System Design
Email Service [Interview Ready] - Gmail

Email Service [Interview Ready] - Gmail

Design an email service like Gmail that allows users to send, receive, and manage emails. The system should be able to handle a large number of users and be able to scale as the number of users grows.

Example:

Suppose we need to build an email service like Gmail for a messaging app with 100 million users. Users should be able to send and receive emails from any email address, and the system should provide features like labels, filters, and a search function to help users manage their emails effectively.

Functional Requirements:

  • Users should be able to send and receive emails from any email address.
  • Users should be able to organize their emails with labels and filters.
  • Users should be able to search their emails using keywords and other search criteria.
  • Users should be able to compose emails with formatting options and attachments.
  • Users should be able to forward, reply to, and delete emails.
  • Users should be able to flag important emails for follow-up.
  • Users should be able to create and manage folders to store emails.
  • Users should be able to access their emails on multiple devices and platforms.
  • The system should be able to handle a large number of users.

Non-functional Requirements:

  • The system should be able to handle a large number of concurrent users.
  • The system should be able to scale horizontally to handle larger volumes of users.
  • The system should be fault-tolerant and able to recover from errors.
  • The system should be able to run continuously with minimum downtime.
  • The system should be able to handle a high volume of emails without impacting performance.
  • The system should be able to deliver emails in real-time, with minimal latency.
  • The system should provide strong security measures to protect user data and prevent unauthorized access.

Assumptions:

  • The system assumes that users are authenticated and authorized to use the service.
  • The system assumes that emails are not confidential and can be stored in a database for analysis and auditing.
  • The system assumes that users are not sending malicious emails or attachments.

Estimated Usage:

  • The system should be able to handle at least 10 million daily active users.
  • The system should be able to handle at least 100,000 emails per second.