Design Google Maps
Two systems wearing the same skin: a pyramid of pre-drawn tiles you pan and zoom, and a road graph cut into tiles you route across. From the naive one-server cut to a static tile pyramid on a CDN, hierarchical routing tiles searched with a live A*, ~1M-QPS location ingestion, and live-traffic ETAs — drawn, computed, and animated.
System design · Systems. The source ↗
A free, interactive, animated visual explainer of Design Google Maps — built to be understood, not skimmed.
Questions
- How does Google Maps store the whole map — as one giant image?
- No — it stores a pyramid of small tiles. At zoom 0 the entire world is a single 256×256-pixel tile; every zoom step splits each tile into four more detailed ones, so by zoom 21 there are more than 4 trillion tiles. They are pre-rendered once and served from a CDN as immutable, cache-friendly files, keyed by zoom plus x/y position (a quadtree path), so a view is assembled from cached tiles rather than rendered live.
- What is the difference between map tiles and routing tiles?
- They are two completely different cuts of the world. Map tiles are the pictures you look at — a zoom pyramid of images served from a CDN. Routing tiles are the road graph — intersections as nodes and roads as weighted edges — partitioned geographically and cut into three levels of importance (local streets, arterials, highways) so a router can load only the tiles a trip touches instead of the whole planet.
- How does Google Maps compute a cross-country route so fast?
- By searching a hierarchy, not a flat graph. A* is guided toward the destination by a straight-line heuristic, and the routing tiles let it ride a sparse highway-level graph across the long middle while loading dense local streets only near the start and end. That keeps the number of nodes explored small. Production systems go further with contraction hierarchies — precomputed shortcut edges that skip unimportant intersections — answering continent-scale queries in microseconds.
- Where does Google Maps get live traffic data?
- From anonymized location reports sent by phones running the app — hundreds of millions of devices acting as speed probes, on the order of a million location writes a second. Phones batch their pings into a partitioned log (Kafka-shaped, partitioned by geographic cell); a traffic-aggregation consumer rolls raw probes into a current speed per road segment in a write-optimized store, and those speeds become the edge weights the router reads. ETAs combine this live signal with historical patterns.
- What are raster tiles versus vector tiles?
- Raster tiles are finished PNG images the server pre-renders; the client just displays them. Vector tiles ship the road and polygon geometry as data and let the device draw it. Google switched Maps to vector tiles in 2013 because the client can then keep labels positioned, maintain road widths, and scale all the polygons for smooth fractional zoom — with much smaller payloads and the ability to restyle on the fly.