Google Maps live traffic: how a road turns red (System Design Notes)
How Google Maps knows a road is jammed without a single camera: anonymous location and speed from phones, road segments and Supersegments, what green, orange and red really mean, the DeepMind Graph Neural Network behind ETAs, the 99-phone Berlin hack, why Maps sends you into a gali, and how to answer 'design live traffic' in an interview.
By InternHack Team · · 15 min read · System Design
It's 9 AM, the road on your Maps is red, and you're going to be late. Google doesn't have a single camera on that road. So who told it? The answer is sitting in your pocket.
In these notes we break Google Maps live traffic down like a system design problem: where the data comes from, how thousands of phone pings become one coloured road, what Google does about privacy, how the ETA predicts traffic 20 minutes ahead, why the system can be fooled, and a ready answer for "Design live traffic for a maps app" in an interview. This is Part 7 of our Real Life System Design series. Part 6 (the Swiggy/Zomato live map) was about one rider's phone sending its location; this is what happens when millions of phones do it.
Facts come from Google's own blog posts, the DeepMind blog and paper, Google Maps Help and developer docs, and news coverage, listed at the end. Google does not publish how often a phone sends location for traffic, the minimum number of phones per road, or the exact speeds behind each colour. Anything we couldn't confirm from a primary source is marked unverified.
Your phone is the traffic sensor
Google Maps does not watch roads with cameras. In Google's own words (Google Maps PM Johann Lau, Sep 2020), it "analyzes historical traffic patterns for roads over time", combines them with live conditions using machine learning, and "aggregate location data can be used to understand traffic conditions on roads all over the world." It also uses "authoritative data" (speed limits, tolls, restrictions) and "incident reports from drivers".
The crowdsourcing idea goes back to 25 Aug 2009. Google's blog post that day said that when you enable Google Maps with My Location, "your phone sends anonymous bits of data back to Google describing how fast you're moving" (quoted via AFP/Phys.org, because the original page body didn't load for us). Google's line then: "the more people that participate, the better the resulting traffic reports get for everybody."
So the picture is simple:
- Your phone (location on) sometimes sends Google an anonymous note: where it is and how fast it's moving. No name.
- Google's servers match those notes to road segments and average the speeds of many phones on each segment.
- They compare that speed with what's normal for the road, and paint it green, orange or red.
If 500 phones on a stretch all say "I'm moving at 6 km/h" on a road that usually moves at around 40, that stretch goes red. (The 500 phones and 40 vs 6 are an illustrative example, not Google numbers.)
How often does a phone send its location for traffic? Not published (unverified). Any "every second" or "every 5 seconds" claim you see has no source.
System design lesson: You don't need sensors on every road if every car already carries one. Crowdsourcing turns millions of phones into a traffic camera network, and the more people take part, the better it gets.
Sign up free to unlock the full notes
Aage ke sections free InternHack account ke saath khulte hain:
- The actors in the system
- Privacy at the door
- From pings to a coloured road, step by step
- The ETA: history plus live, through a Graph Neural Network
- Edge cases: why a road turns red when it shouldn't
- Why Maps sends you into a gali
- India specifics and numbers worth remembering
- Myths to avoid
- How to answer this in an interview
Sources
- Google Keyword, "Google Maps 101: How AI helps predict traffic and determine routes" (Johann Lau, 3 Sep 2020): https://blog.google/products/maps/google-maps-101-how-ai-helps-predict-traffic-and-determine-routes/
- DeepMind blog, "Traffic prediction with advanced Graph Neural Networks" (3 Sep 2020): https://deepmind.google/discover/blog/traffic-prediction-with-advanced-graph-neural-networks/
- Derrow-Pinion et al., "ETA Prediction with Graph Neural Networks in Google Maps", CIKM 2021: https://arxiv.org/abs/2108.11482
- Google Maps Help, traffic colours: https://support.google.com/maps/answer/3093389
- Google Privacy, "How Google uses location information": https://policies.google.com/technologies/location-data?hl=en
- Google Official Blog, "The bright side of sitting in traffic" (Dave Barth, 25 Aug 2009): https://googleblog.blogspot.com/2009/08/bright-side-of-sitting-in-traffic.html (quotes via AFP/Phys.org: https://phys.org/news/2009-08-google-tracking-traffic.amp)
- Google Maps Platform, Routes API "Traffic on polylines": https://developers.google.com/maps/documentation/routes/traffic_on_polylines
- Google Maps Platform, Navigation Connect FAQ: https://developers.google.com/maps/documentation/navigation/connect/faq
- Google India blog, "Six ways we're enabling more efficient and sustainable journeys on Google Maps in India" (25 Jul 2024): https://blog.google/intl/en-in/products/explore-communicate/six-ways-were-enabling-more-efficient-and-sustainable-journeys-on-google-maps-in-india-powered-by-ai-and-local-partners/
- Simon Weckert, "Google Maps Hacks": http://www.simonweckert.com/googlemapshacks.html
- The Register (3 Feb 2020): https://www.theregister.com/2020/02/03/google_maps_hack_cartful_phones/
- WTOP/AP, with Google's statement (4 Feb 2020): https://wtop.com/tech/2020/02/artist-pulling-wagon-fakes-out-google-maps-creates-traffic-jams-on-empty-streets
- MediaNama, India live traffic launch (4 Sep 2012): https://www.medianama.com/2012/09/223-google-to-extend-its-voice-navigation-service-to-india/
- Bengaluru walk vs drive (Curly Tales, secondary): https://curlytales.com/bengalurus-traffic-woes-google-maps-suggests-walking-5-8-km-for-42-mins-is-faster-than-for-driving-44-mins
- Ashish Kacholia missed flight (Zee News, secondary): https://embed2.zeenews.com/india/cant-rely-on-google-maps-in-bengaluru-investor-ashish-kacholia-misses-flight-due-to-traffic-2785482.html
- Ukraine live traffic disabled (TechCrunch, 28 Feb 2022, secondary): https://techcrunch.com/2022/02/28/google-disables-maps-live-traffic-tools-in-ukraine
- HuffPost India on map apps and quiet neighbourhoods (2018): https://www.huffingtonpost.in/2018/07/03/how-your-map-app-is-turning-quiet-neighbourhoods-into-traffic-jammed-nightmares_a_23473345/
- Google Maps 2 billion users (9to5Google, Oct 2024, secondary): https://9to5google.com/2024/10/29/google-maps-2-billion/
- MetaFilter thread on the Weckert hack: https://metafilter.com/185427/Turning-green-streets-red
- Team-BHP live traffic thread (Jan 2013): https://www.team-bhp.com/forum/street-experiences/131095-live-traffic-updates-now-google-maps.html
- Bengaluru signal pilot (Hans India, 2022, secondary): https://thehansindia.com/karnataka/bengaluru-becomes-first-city-to-collaborate-with-google-to-ease-traffic-congestion-755530
Google does not publish the phone ping interval for traffic, the minimum number of phones per segment, or the speed thresholds for each colour; these remain unverified. The full 2009 Google blog text was read only through AFP and search excerpts.