Latest / The CTO Podcast with Fexingo: Technical Leadership, Architecture, and Engineering Org / How Uber Rebuilt Its Maps for 40 Million Daily Rides
Transcript
- Lucas: If you've ever opened Uber and watched the little car move across the map, you probably assumed that map comes from Google. And for a long time, you'd be right. But around 2019, Uber's engineering leadership made a very expensive bet: rebuild the entire mapping and routing stack from scratch. Luna: Why would they do that? Google Maps is — well, it's Google Maps. It's the gold standard. Lucas: It is, and that was exactly the problem. Uber was paying Google a huge licensing fee — think hundreds of millions of dollars per year. And in 2019, Google sent a letter saying that fee was going up by about 40 percent. That got the CTO's attention pretty fast. Luna: So it was purely a cost play? Or were there technical reasons too? Lucas: It started as cost, but once they started digging, they found deeper issues. The Google Maps API wasn't designed for Uber's specific needs. For example, when you request a ride, Uber needs to compute the fastest route between you and the driver — but it also needs to do that for every nearby driver simultaneously, in under 100 milliseconds. Google's API was too slow and too rigid for that kind of batch optimization. Luna: So they built their own routing engine. What did they call it internally? Lucas: Michelangelo Maps — named after the artist, not a person. The core idea was modularity. They split the problem into three layers: a tile-based geocoding service, a routing kernel written in C++, and a machine learning model for travel time prediction. Each layer could be updated independently. Luna: Let's unpack the routing kernel first. That's the heart of it, right? Computing the shortest path. Lucas: Yeah, exactly. The kernel uses a variant of the Contraction Hierarchies algorithm — it precomputes a hierarchy of roads so that at query time, it only needs to search a small subset. They optimized it to run in under 50 milliseconds on a single CPU core. That's fast enough to evaluate dozens of driver-rider pairs in real time. Luna: And the geocoding layer? Because knowing where '123 Main Street' is on a map is not trivial. Lucas: Right, geocoding is surprisingly hard. Uber's system uses a tile-based approach: they divide the world into a grid of 100-meter-by-100-meter tiles, and each tile has a precomputed list of addresses and landmarks. When a user types an address, the system only searches the relevant tile plus its immediate neighbors. That cut the number of database queries by about 80 percent compared to the old Google-based pipeline. Luna: And the machine learning model — that's for ETAs, I assume. Lucas: Yes. Google's API gave a static estimate based on speed limits and historical averages. Uber's model is dynamic: it takes into account real-time traffic, weather, time of day, and even local events. They claim the model predicts travel time to within 5 percent of actual trip duration, on average. That's a huge improvement for both riders and drivers. Luna: So after three years of work, did they actually kill the Google dependency entirely? Lucas: Not entirely. The map tiles you see on screen — the visual map — still come from Google in many regions. But the core routing, geocoding, and ETA predictions are now Uber's own. They estimate they saved over a billion dollars in licensing fees in the first two years after full rollout. Luna: That's a huge number. But I wonder — was there a moment during the rebuild where they thought it might fail? Because this is a massive bet on infrastructure that touches every single ride. Lucas: Absolutely. There was a near-crisis in early 2020, right when COVID hit and ridership dropped by 80 percent in some cities. The team had to decide whether to keep funding the rebuild or cut it. They actually doubled down, because they saw that with fewer rides, it was the perfect time to test the new system without risking user experience at scale. Luna: That's a smart move. And it probably paid off when ridership came back. Lucas: It did. By mid-2021, they were handling 40 million daily rides on the new stack. One interesting technical detail: the C++ kernel is so efficient that they run it on fewer servers than the old Google API consumed. Their server cost per route actually went down by about 60 percent. Luna: So the cost savings aren't just from not paying Google — they're also from better efficiency. Lucas: Exactly right. And that's the kind of compound benefit you get when you build for your own use case. Google's API is general-purpose; it's designed to serve everyone from a food delivery app to a hiking trail site. Uber's stack is hyper-specialized for on-demand transportation. Luna: One thing I'm curious about — how did they handle the transition? You can't just flip a switch and move 40 million rides to a new system overnight. Lucas: They used a technique called shadow testing. For several months, every request to the Google API was also sent to Michelangelo Maps, but the result was only used internally for comparison. They measured things like route quality, ETA accuracy, and system latency. Only when the new system consistently outperformed the old one did they start routing actual rides through it, city by city. Luna: That's reassuring. But I imagine there was still the occasional disaster. Any memorable outages? Lucas: There was one in Los Angeles in late 2021. The geocoding tile for downtown LA had a bug that caused all addresses to be shifted one block west. For about two hours, every ride pickup was off by a block. They fixed it by adding a canary deployment — rolling out updates to a small percentage of traffic first. Luna: So they learned the hard way that even with shadow testing, you need progressive rollouts. Lucas: Exactly. And that's a lesson that applies to any infrastructure migration, not just mapping. Luna: We talk a lot about these deep engineering decisions on this show, and it's only possible because of listeners who support us directly. A handful of folks chip in monthly through buy me a coffee dot com slash fexingo, and that's literally what funds making episodes like this one. Lucas: Yeah, it's a small group, but it makes a big difference. Keeps the show ad-free and lets us spend time on these deep dives. Luna: So if you find these conversations useful for what you're building or running, that link again is buy me a coffee dot com slash fexingo. Now, back to Uber's maps — one thing I didn't ask: how did they handle real-time traffic updates? Lucas: Great question. They ingest data from their own fleet of drivers — basically, every Uber car sends speed and location data back. That feeds into a traffic model that updates every two minutes. The ML model then incorporates that into ETA predictions. It's a virtuous cycle: more rides means better data, which means better ETAs, which means more rides. Luna: That's a classic network effect. And it's something Google can't easily replicate because they don't have real-time speed data from millions of cars every minute. Lucas: Exactly. That's Uber's moat. And it's why the rebuild was worth it — not just to save money, but to own the data that makes the product better. Luna: So looking back, would you say the three-year timeline was justified? Or could they have moved faster? Lucas: I think three years was about right for a system of this complexity. They had to build the routing kernel from scratch, which involved months of research into algorithms. The geocoding tile system required digitizing and validating addresses across 10,000 cities. And the ML model needed months of training data. Rushing it would have risked reliability. Luna: And reliability was non-negotiable, given that lives are at stake — people going to hospitals, airports, etc. Lucas: Precisely. Uber's CTO at the time, Thuan Pham, is quoted saying that a 1 percent increase in ETA error leads to a measurable drop in ride completion rates. So accuracy isn't just a nice to have; it directly impacts the bottom line. Luna: Alright, final question: if you were a CTO at a company that depends on a third-party API for a core function, what would you take away from Uber's story? Lucas: I'd say: start measuring your dependency cost and performance early. Don't wait for a 40 percent price hike to force your hand. And if you do decide to build, use shadow testing and progressive rollouts. It's the only sane way to migrate critical infrastructure. Luna: Sound advice. And maybe don't call it Michelangelo unless you're prepared for a masterpiece. Lucas: Ha, yeah. Though I think the real masterpiece here is the engineering discipline — not the name.