KatInterview

Design an Enterprise Calendar System

System DesignModel answer
MediumModel answerSystem Designsystem-designdistributed-systemscalendar

Last updated

Architect a scalable calendar service handling interval-based queries, concurrent updates, recurring schedules, and real-time user invitations.

Architect a scalable backend service for an enterprise calendar system (similar to Google Calendar or Outlook).

Requirements

Functional Requirements

  1. Core Operations: Users can create, update, view, and cancel calendar events.
  2. Range Queries: Users can view all events occurring within a specified time window (e.g., day, week, month view).
  3. Attendees & Invitations: Events can have multiple participants who receive invitations and update their RSVP status (Yes, No, Maybe).
  4. Recurring Events: Support recurring patterns (daily, weekly, monthly) with exceptions (e.g., moving or deleting a single instance in a series).
  5. Reminders/Notifications: Deliver scheduled notifications to participants prior to an event starting.

Non-Functional Requirements

  1. High Availability & Scalability: Support 100M daily active users (DAU) with high read availability (99.99%).
  2. Low Latency: Time-range queries for a user's calendar view must return within < 100ms.
  3. Eventual Consistency vs. Strong Consistency: Strong consistency for event scheduling/modifications; eventual consistency acceptable for attendee notifications and feed updates.

System Scale (Estimates)

  • 100M DAU.
  • Average user checks their calendar 10 times a day ($1\text{B}$ read requests/day $\approx 12,000\text{ QPS}$).
  • Average user creates/updates 2 events per day ($200\text{M}$ write requests/day $\approx 2,300\text{ QPS}$).
  • Read-to-write ratio is roughly 5:1.

Explain the data models, API endpoints, key architectural components, strategies for handling recurring events, and concurrency management for simultaneous event updates.