Design Google Maps: Vector Tiles, Hierarchical Routing & Real-Time ETA
Routing Across 1 Billion Kilometers of Road in Milliseconds
Google Maps Vector Tiles & Routing Architecture
1. Map Rendering: Raster vs. Vector Tiles
256×256 PNG raster images for every zoom level (0 = whole Earth in 1 tile, up to zoom 21 = trillions of building-level tiles).- 5×–10× Smaller Bandwidth: Client GPU renders smooth 60fps zoom/rotation transitions without fetching blurry intermediate PNGs.
- Deterministic Addressing with Geohashes: Map tiles are cached globally on CDN edge nodes and addressed deterministically from
(lat, lon, zoom), allowing clients to prefetch neighboring tiles smoothly before you pan!
2. Sub-Second Shortest Path: Hierarchical Routing Tiles
- Partition the World into Routing Tiles: Slice road graphs into zoom-tiered Routing Tiles (Local streets, Regional arterial roads, National highways) stored in S3 and cached in memory on Routing Servers.
- Hierarchical Graph Traversal (Contraction Hierarchies):
- Start at Origin (
Zoom 2local tile) → immediately jump onto nearby arterial roads (Zoom 1regional tile) → ascend onto interstate highways (Zoom 0continental backbone) → cross the country examining only major highway interchanges → descend cleanly at Destination! - By bypassing millions of neighborhood cul-de-sacs along the middle of the route, search space shrinks by 1,000×–10,000×!
- Start at Origin (
3. Live Traffic, Adaptive ETA & Dynamic Rerouting
- Batch GPS Ingestion: Mobile clients batch anonymous
(lat, lon, speed, ts)telemetry pings every ~15 seconds into a Kafka stream (~200K+ QPS). - Traffic Update Service: Stream processors aggregate road-segment speeds in real time, updating edge weights on cached Routing Tiles and publishing live Traffic Tiles for red/yellow/green UI overlays.
- ETA Prediction & Adaptive Rerouting:
- ETA Service: Uses historical patterns + ML time-of-day congestion models to forecast arrival times along the chosen road segments (not just current instantaneous speed).
- Rerouting: Active navigation sessions subscribe to periodic route re-evaluations—whenever a downstream road weight spikes past a savings threshold, the server pushes a faster detour automatically.