Chapter 3: Google Maps System Design
Loading audio…
ⓘ This audio and summary are simplified educational interpretations and are not a substitute for the original text.
The design focuses on three core features: user location update, navigation service including Estimated Time of Arrival (ETA), and map rendering. Foundational geographical concepts are essential, including Map Projection—the process of translating 3D global points to a 2D plane—and Geohashing, an encoding system that recursively subdivides geographic areas into grids, which is critical for efficient map tiling and creating manageable routing tiles. Back-of-the-envelope estimations determine the system's massive scale, requiring roughly 100 petabytes (PB) of storage for precomputed map tiles across 21 zoom levels. To manage server throughput for location updates, the design implements client-side batching, sending updates at a lower frequency (e.g., every 15 seconds) to reduce peak write traffic to about one million Queries Per Second (QPS). The architecture consists of distinct services (Location, Navigation, Rendering). The Location Service uses a highly scalable, write-optimized NoSQL database like Cassandra and streams location data via a message queue, such as Kafka, for consumption by services that update live traffic, improve road data accuracy, and personalize the experience. Map rendering relies on serving static, pre-generated map tiles from a Content Delivery Network (CDN), where the client uses geohashing to compute the correct tile URL based on its location and zoom level. For data efficiency, vector tiles are suggested as an optimization over traditional rasterized images. The Navigation Service employs variations of pathfinding algorithms, such as A*, operating on hierarchical routing tiles stored in object storage, and the ETA Service utilizes machine learning models trained on current and historical traffic data to provide accurate time predictions. To support adaptive ETA and rerouting—which involves updating users in real-time when traffic conditions change—the system favors WebSocket as the delivery protocol for its bi-directional communication capabilities and light server footprint.