Grokking the System Design Interview, Volume II
Vote

0% completed

Gmail: System Definition

Step 1: System Definition

We are designing a distributed email service like Gmail. Millions of users send, receive, and organize messages on it. Sending is asynchronous, which means the sender does not wait for the recipient to be online.

The service does three jobs. It accepts incoming mail. It routes each message to the right recipient's storage. And it gives users a simple interface for reading, searching, and managing conversations.

The system has six key entities. The diagram below shows them and how mail flows between them.

User. An account holder with a unique email address

.....

.....

.....

Like the course? Get enrolled and start learning!
P B

P B

· 7 months ago

The design doesn't mention how bounce would work for incoming emails, whether coming from internal emails or external emails.

P B

P B

· 7 months ago

  • Lack of deep dive about how we will be performing search in the email body. Only ElasticSearch is mentioned in one place.
  • If we are integrating with ElasticSearch anyway, why would we still need SQL and complex indexing. Though later it also mentions "Use inverted indexes: Map keywords -> list of message references. The search service likely maintains multiple indexes: one for email bodies, one for headers, maybe one for senders/recipients for faster specific searches. Querying combines these as needed."
chinmay das

chinmay das

· 4 months ago

The design is written in a way that it seems it is trying to predict / guess what gmail might be doing. "It could be doing this or it could be doing that" This is a system design course. Please define the problem scope and constraints. Choose a smaller scope and create a concrete design that matches the scope. For each flow have a description of how the flow works and make it concrete, whether it is synchronous or asynchronous. how is the queuing done, what could be the partition key. And if you want to give additional information you can add in a section for extension points that explain how some feature X can be implemented by adding this extra component.

Show 1 reply