Google Calendar Day View System Design: Handling 167K Writes Per Second
These articles are AI-generated summaries. Please check the original sources for full details.
Google Calendar — Day View
Google Calendar’s Day View manages 500 million daily active users with a frontend-heavy architecture that maintains 60 fps for complex scheduling interactions. The system handles peak event writes of 167,000 updates per second while ensuring real-time synchronization for shared calendars.
Why This Matters
Theoretical models often suggest NoSQL for massive scale, but Google Calendar utilizes PostgreSQL to maintain ACID compliance for critical relational data like attendee permissions and conflict resolution. This design demonstrates how to balance high-throughput writes with strict consistency requirements by sharding databases by user ID and decoupling notification fan-out via Kafka.
Technical reality requires solving the interval partitioning problem on the client to render overlapping events while handling RRULE expansions server-side. By using optimistic UI updates and direct DOM mutation during drag-and-drop, the system avoids the performance bottlenecks typical of virtual DOM re-renders in high-frequency interaction scenarios.
Key Insights
- Interval partitioning algorithm solves overlapping event layout by sorting events and assigning columns in O(n log n) time on the client-side.
- RRULE expansion is performed at read-time to prevent storage explosion; pre-expanding 10 years of events for 500M users would require billions of unnecessary rows.
- Drag-and-drop interactions achieve 60 fps by bypassing React state and using direct CSS transforms, committing to the database only on ‘drop’.
- WebSocket session routing through Redis allows the Notification Service to push updates to 5M concurrent connections for shared calendar collaboration.
- PostgreSQL sharded by user_id handles 10M updates per minute while providing the strong consistency needed to prevent double-booking.
- Optimistic locking with version fields resolves concurrent edit conflicts on shared events without the complexity of CRDTs.
Practical Applications
- Use Case: Shared corporate calendars utilize Kafka and a Notification Service to fan out event updates to up to 5,000 members without blocking the primary write path.
- Pitfall: Pre-expanding recurring events into individual database rows leads to massive write amplification; store the RRULE string and expand only the requested date range.
- Use Case: High-performance time-grid UIs use virtual scrolling to render only visible hours, keeping DOM node counts low even in complex 24-hour views.
- Pitfall: Polling for real-time updates at a 500M user scale creates massive overhead; WebSockets ensure data is only transmitted when a change actually occurs.
References:
Continue reading
Next article
How Self-Healing Infrastructure Reduces MTTR by 90%
Related Content
System Reliability Lessons from Nigeria's ₦1.92 Trillion Market Crash
Nigeria's stock market lost ₦1.92 trillion following a single regulatory change, offering a masterclass in single points of failure and eventual consistency.
Software Modeling Blueprint: Flowchart, Functional, and Sequence Diagrams
Learn the three-lens progression—behaviour, structure, and interaction—to create traceable blueprints for software systems using a Twitter clone example.
System Design From Scratch: The Components That Actually Run Production Systems
Learn how Amazon loads product pages in under a second using DNS, CDNs, load balancers, and Redis caching to handle millions of concurrent users.