The Wayback Machine - https://web.archive.org/web/20241117013636/https://www.geeksforgeeks.org/system-design-design-google-calendar/
Open In App

System Design – Design Google Calendar

Last Updated : 20 Apr, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Google Calendar is like a special calendar that we can use on our computer or phone. We can use it to remember important things, like birthdays, appointments, and events. We can also set reminders to help us remember when something is coming up soon. We can also share our calendars with our family or friends. It’s like having our own special schedule that helps us keep track of everything that we need to do.

With Google Calendar, we can quickly schedule meetings and events and get reminders about upcoming activities, so we always know what’s next.

Requirements of the System:

Functional Requirements:

  • Book an event: In a calendar, we are able to add an event with other people. It can be a single user or multiple users.
  • Check availability of users: While we are scheduling an event before that if we can figure out in that particular time the person is available or not.
  • Invite users to the meeting/event: The user should be able to invite other users to the meeting or event. The number of users invited for a scheduled meeting can be one or more than one.
  • Request RSVP: Before posting an invite to the person we want to know if that particular user is already blocked or if he is available. So these types of responses can be handled by requesting RSVP.
  • Meeting Reminders: Getting a notification before the time for a particular meeting with a particular person about the agenda and all those details would help prepare for the meeting beforehand.
  • Modify the meeting /event: This includes making changes to an existing meeting or event that you have created or have been invited to.
  • Cancel a meeting/event: This includes deleting or removing a meeting or event that you have created or have been invited to.
  • Lookup for all meetings in the calendar: This includes viewing a list of all events that have been designated as meetings or events.
  • View Calendar: This allows the user to see their scheduled events and appointments in a visual format which can be a monthly, weekly, or daily view, and it includes details such as the date, time, location, and description of each event.

Non-Functional Requirements:

  • High availability: This means that users should be able to use Google Calendar whenever they need it, without experiencing any significant interruptions or downtime.
  • Eventual Consistency: This means that sometimes changes made to an event might not show up for everyone right away, but eventually the changes will be applied and everyone’s calendar will show the same updated event.
  • Low/minimum latency: This means that the application should respond quickly to your requests and updates, so you don’t have to wait for a long time to see your changes.
  • Durable storage: The system should be durable enough to not lose any kind of user and meeting data.

Memory and Estimations of the System

Let’s start with the estimation and constraints because these things help us to make better design decisions that’s why we do estimations along with the requirement gathering.

Assumptions:

Let’s assume the system is designed for 100M users.

So, the number of concurrent users=100M

And out of all these users, 1/10 of the people are actually scheduling the event.

So, 1/10 post invites=10M

And assuming a particular person creates 5 events in a day.

So, 5 events/ user=50M invites per day

So, storage for 1 invite={ Meeting content +userId, invite list+date }

                                    = 1 KB

Therefore, the Total storage=1KB*50M

                                            = 50,000,000KB

                                            = 50GB/day

Storage for 1 year = 50*365

                              = 20TB/year

 

Data Flow Diagram

Data flow for a particular user viewing the Calendar

data flow for the user viewing the Calendar

1. The user opens the Google Calendar app on their device.

2. The device sends an HTTP request to the Google server to authenticate the user and establish a secure connection.

3. The Google server verifies the user’s credentials and sends an HTTP response to the user’s device.

4. The device sends an HTTP request to the Google server to retrieve the user’s calendar data.

5. The Google server retrieves the user’s calendar data from the Google Calendar database.

6. The device displays the calendar data to the user through an interface.

7. The user interacts with the calendar by adding, modifying, or deleting events or changing settings.

8. The Google server processes the requests and updates the user’s calendar data in the Google Calendar database.

data flow diagram of the entire system

data flow diagram of the entire system

1. The user creates an event in their Google Calendar by providing event details such as the event name, date, time, and location.

2. The event data is stored in the user’s Google Calendar account, which is hosted on Google’s servers.

3. User invites attendees: If the event has attendees, the user can send out invitations to those attendees using their email addresses or by sharing a link to the event.

4. Attendees respond to the invitation: The attendees receive the invitation and can choose to accept, decline, or tentatively accept the invitation. Their responses are recorded in the event data.

5. Event reminders: If the user has set reminders for the event, these reminders are triggered at the appropriate times, based on the user’s preferences.

6. Event notifications: If the user has set notifications for the event, these notifications are sent to the user’s devices at the appropriate times, based on the user’s preferences.

7. Event updates: If the user makes changes to the event, such as changing the date or time, these updates are synchronized across all devices and attendees are notified of the changes.

8. Event deletion: If the user deletes the event, it is removed from their Google Calendar account and attendees are notified that the event has been canceled.            

 

Database schema and design

We would have the following tables to work along:

Database Schema Design

It is basically about understanding the requirement from a functional perspective and deciding how we are going to utilize the database and how are we going to design it.

While our data model seems quite relational, we don’t necessarily need to store everything in a single database, as this can limit our scalability and quickly become a bottleneck.

We will split the data between different services each having ownership over a particular table. Then we can use a relational database such as PostgreSQL or a distributed NoSQL database such as Apache Cassandra for our use case.

API design of the system

Let us do a basic API design for our services:

1. Display info for each user.

@GET /api/users/{userId}

For Scheduled Meetings or Events

2. Get meetings for the user for the current week

@GET /api/users/{userId}/meetings
{
     date: currentDate,
     days: 7
}

3. Creating the meeting Event

@POST /api/users/{userId}/meetings
{
     startTime: anyStartTime,
     endTime: anyEndTime,
     “users”: [“abc@gmail.com”,”xyz@gmail.com”],
     “subject”: “Important Meeting”,
     “meetingBody”: “Let’s have a stand-up”
}

4. Updating a meeting Event

PUT /api/users/{userId}/meetings/{meetingId}
{
   startTime: anyStartTime,
   endTime: anyEndTime,,
   “users”: [“abc@gmail.com”, “xyz@gmail.com”],
   “subject” : “Meeting Cancelled”,
   “meetingBody”: “Let’s have a stand-up”
}

For Reminders

A reminder consists of:

  • When to show the reminder, expressed minutes before the event starts time.
  • The delivery method to use.

Reminders can be specified for whole calendars and for individual events. Users can set default reminders for each of their calendars; these defaults apply to all events within that calendar. However, users can also override these defaults for individual events, replacing them with a different set of reminders.

5. Setting up the default meeting reminder

“reminders“: {
  “useDefault“: false,
  # Overrides can be set if and only if useDefault is false.
  “overrides“: [
      {
        “method“: “reminderMethod”,
        “minutes“: “reminderMinutes”
      },
      # …
  ]
}

The delivery methods offered by the system are:

  • Pop-up: These are supported on mobile platforms and on web clients.
  • Email: Sent by the server.

High-Level Design of the System

Design for a particular user viewing the Calendar and the related events/meetings to that user

Design for a particular user viewing the Calendar and the related events/meetings to that user

Overall High-Level Design of the System

The high-level design of the system

Microservices Used

Meetings Microservice

Let’s have a look at how a user can create a meeting for a group of users:

  • Validated POST request for a new meeting comes to the backend. After validation of each field, the backend makes a call to the Meetings microservice to create a meeting.
  • This microservice makes an entry in the meetings table with all the details from the request body.
  • For each user in the invitees’ list, add the entry for each user in the invites table.
  • Send the list of invites to the Notification generation microservice to notify all users of the meeting info.

Notification Microservice

  • This is very simple. It reads from the queue all the invites and sends a notification through email to the users.

Conclusion

In conclusion, designing a system like a Google Calendar needs careful consideration of various components and features which would be crucial to its functionality. The system must be scalable and flexible, allowing for easy integration with other applications and platforms. It should also be secure and reliable. 

Overall, a well-designed system for Google Calendar should provide users with a reliable and efficient tool for managing their daily schedules and events, while also should be allowing for easy collaboration and integration with other applications and platforms.



Similar Reads

Design a system that counts the number of clicks on YouTube videos | System Design
Designing a Click Tracking System for YouTube Videos involves architecting a comprehensive and efficient solution to monitor and analyze user interactions with videos on the YouTube platform. Important Topics for Counting the number of Clicks on Youtube Videos System DesignRequirementsCapacity EstimationLow-Level Design (LLD)Database Design-High-Le
15+ min read
Design Restaurant Management System | System Design
In the modern restaurant industry, delivering exceptional dining experiences requires more than just good cuisine. Restaurant Management Systems have emerged as the secret ingredient for efficient operations and customer satisfaction. In this article, we are going to design a restaurant management system where users can effortlessly discover nearby
15 min read
Design a Picture-Sharing System - System Design
In the present day, the need for good tools to exchange and organize images has never been this much higher. As for social networking, e-shopping, personal branding, and many other related purposes, users anticipate that the sites they visit provide them with fast and dependable environments with or without loads of images that enable them to inter
11 min read
Designing Google Maps | System Design
A web mapping tool called Google Maps offers a range of geographic data, such as street maps, satellite photos, streets' aerial views, real-time traffic reports, and directions. There are several versions of it available, such as web, mobile, etc. In this article, we will see the system design of Google Maps Important Topics for the Google Maps Sys
11 min read
Google System Design Interview Questions
Preparing for a Google System Design interview requires a deep understanding of designing scalable, fault-tolerant, and efficient systems. This article explores key system design concepts, questions, and strategies to help you ace the interview and build scalable solutions across millions of users. Table of Content How to Approach Google System Des
14 min read
Difference between System Design and System Architecture
When it comes to software development and engineering there can be some confusion, between the two terms "System Design" and "System Architecture." Although they are related they actually refer to stages and responsibilities in creating scalable and efficient systems. It is important to grasp the differences, between System Design and System Archit
3 min read
Distributed Messaging System | System Design
In our fast-paced world, how we share information matters more than ever. Old-school messaging setups sometimes struggle to keep up with today's tech demands. That's where distributed messaging systems step in. They're like a breath of fresh air, changing the game and making sure our messages get where they need to go, no matter what. Important Top
8 min read
System Analysis | System Design
In the areas of science, information technology, and knowledge, the difficulty of systems is of much importance. As systems became more complicated, the traditional method of problem-solving became inefficient. System analysis is to examine a business problem, identify its objectives and requirements, and then design the most optimal solution to fu
6 min read
Designing Authentication System | System Design
Keeping your important digital information safe is like building a strong foundation, and the key to that is a good security system. This article will help you understand how to make a robust security system step by step. We'll start with figuring out what you want to protect and what you want to achieve. Then, we'll talk about the detailed design
10 min read
Designing Parking Lot (Garage) System | System Design
Parking garage plays an important role in today's world, as the number of vehicles is increasing every day, so it has become a major concern to manage them. The parking garage provides the solution to this problem of limited space. It offers to book a Parking garage using any method whether online or offline. In this article, we will explore all th
11 min read
System Design | Online Banking System
In the digital era, the layout of a Online Banking System is a critical element of any commercial enterprise, it not only affects user experience but also the growth of a service-providing company. This article explores the comprehensive guide to designing a Online Banking System for its efficient use. From practical and non-useful requirements to
12 min read
Resilient System - System Design
Imagine you're building a castle out of blocks. If you design it so that removing one block doesn't make the whole castle collapse, you've made something resilient. hen we talk about creating a resilient system, we're essentially doing the same thing but with computer systems. These systems are designed to handle problems like errors, crashes, or e
10 min read
Blob vs. File System in System Design
In system design, choosing the right method for storing and managing data is crucial for performance, scalability, and maintenance. Two common approaches are using Blobs (Binary Large Objects) and traditional file systems. Each has its own set of advantages and challenges, making them suitable for different use cases. This article explores the key
7 min read
Differences between System Analysis and System Design
System Analysis and System Design are two stages of the software development life cycle. System Analysis is a process of collecting and analyzing the requirements of the system whereas System Design is a process of creating a design for the system to meet the requirements. Both are important stages as it helps to create an effective system with all
4 min read
System Development Life Cycle vs. System Design Life Cycle
The concepts of System Development Life Cycle (SDLC) and System Design Life Cycle (SDLC) are fundamental in the field of software engineering and system architecture. Both frameworks play crucial roles in the creation and implementation of complex systems, but they address different aspects of system creation and management. Important Topics for Sy
6 min read
System Design of Uber App | Uber System Architecture
Getting the hassle-free transportation service(Uber, Ola) is very easy but is it also simple to build these gigantic applications that have hundreds of software engineers working on them for a decade? surely not. These systems have much more complex architecture and there are a lot of components joined together internally to provide riding services
13 min read
How to Design a Rate Limiter API | Learn System Design
A Rate Limiter API is a tool that developers can use to define rules that specify how many requests can be made in a given time period and what actions should be taken when these limits are exceeded. Rate limiting is an essential technique used in software systems to control the rate of incoming requests. It helps to prevent the overloading of serv
11 min read
System Design - Design a Sequencer
Pre-requisites: Logic gates Sequencer is a device that generates a sequence of unique identifiers or numbers. In the context of distributed systems, a sequencer is often used to generate unique IDs and objects across multiple nodes or servers. In this article, we will discuss how to design a sequencer for use in a distributed system. The sequencer
5 min read
Design Principles in System Design
Design Principles in System Design are a set of considerations that form the basis of any good System. But the question now arises why use Design Principles in System Design? Design Principles help teams with decision-making, and is a multi-disciplinary field that involves trade-off analysis, balancing conflicting needs, and making decisions about
5 min read
Design Notification Services | System Design
If we are building an e-commerce application or a booking system or anything of that sort, we will always have a notification service that will be used to notify your consumers. Let us now look at the requirements to build a notification service. Topics for Designing Notification ServicesRequirementsComponentsHow does our system tackle if we want t
8 min read
Design Facebook's live update of comments on posts | System Design
A live comment system, like Facebook's, works by employing real-time communication technologies, such as WebSockets, to establish a persistent connection between users and the server. When a user posts a comment, it's immediately sent to the server, which then broadcasts the comment to all users viewing the same post in real-time. This allows users
15+ min read
Design a webpage that can show the status of 10M+ users including: name, photo, badge and points | System Design
We've got this huge community—over 10 million strong—and you want to build a webpage where everyone's details, like their names, photos, those cool badges they've earned, and their points, can all be seen. That's a massive load of information to handle. Achieving this goal necessitates an efficient and scalable system architecture capable of handli
15+ min read
Design Reddit | System Design
Designing Reddit is not just about sharing posts and comments; it's about managing a bustling community, ensuring everyone's voice is heard, and delivering personalized content to keep users engaged. Let's dive into the system design of Reddit to handle a huge amount of user-generated content while making sure everyone gets their slice of the conve
15+ min read
Design Facebook | System Design
Designing a system as complex and globally impactful as Facebook requires careful consideration of various factors, including scalability, reliability, and performance. This article explores the key components and architectural decisions involved in designing Facebook, focusing on its core functionalities and the challenges of supporting billions o
14 min read
Design Spotify Premium | System Design
In today's digital world, the demand for premium music streaming services like Spotify is at an all-time high. Understanding the System Design behind Spotify Premium is crucial for software engineers seeking to build robust, scalable, and reliable music streaming platforms. This article explores the architecture of Spotify Premium, offering insight
13 min read
What is the Correlation Between System Design and Design Patterns?
System design and design patterns are closely related concepts in software engineering, with design patterns serving as reusable solutions to common design problems encountered during system design. System design and design patterns are interrelated concepts that work together to create robust and well-structured software systems. Important Topics
11 min read
System Design vs. Software Design
System Design and Software Design are two important concepts in the creation of robust and effective technological solutions. While often used interchangeably, they represent distinct disciplines with unique focuses and methodologies. System Design encompasses the architecture and integration of hardware, software, and network components to achieve
8 min read
How Would you Design Amazon.com's Database - System Design
A thorough approach to designing Amazon's database involves managing customers, product catalogs, order processing, and recommendations alongside other elements. To ensure scalability, these components must be integrated: load balancers, application servers, caching, CDNs, search engines, and analytics tools. The key to building a robust and effici
12 min read
Design Web Crawler | System Design
Creating a web crawler system requires careful planning to make sure it collects and uses web content effectively while being able to handle large amounts of data. We'll explore the main parts and design choices of such a system in this article. Important Topics for Web Crawler System Design Requirements Gathering for Web Crawler System DesignCapac
8 min read
Design Distributed Job Scheduler | System Design
In today's technology-driven world, it's critical to handle computing tasks across different systems efficiently. A Distributed Job Scheduler system helps coordinate the running of tasks across multiple computers in a distributed computing environment. It manages the scheduling, distributing, and tracking of these tasks, including data processing,
11 min read
Article Tags :
three90RightbarBannerImg