Latest / The CTO Podcast with Fexingo: Technical Leadership, Architecture, and Engineering Org / How Apple Rebuilt Its Maps Backend for 10 Billion Directions Requests
Transcript
- Lucas: If these conversations are useful for what you're building or running, we've got a little way you can keep them going — but let's get into today's story first. Lucas: Apple Maps launched in 2012 to near-universal derision. Roads that looked like melted spaghetti, misplaced landmarks, directions that sent people into rivers. It was bad enough that Tim Cook issued a public apology and reportedly fired the head of iOS software. Luna: And then they spent the next eight years basically rebuilding the whole thing from scratch, right? I remember when they started sending those camera cars around. Lucas: Exactly. But the part that usually doesn't get enough attention is the routing engine — the actual system that computes a path from A to B. By 2025, Apple Maps was processing something like 10 billion direction requests per day. That's more than Google Maps processes on a busy day, though Apple doesn't publish exact numbers. Luna: Ten billion. And that's with a routing engine that started life as a thin wrapper around TomTom's API? That's a massive shift. Lucas: Right. The original architecture was a classic third-party dependency play. Apple licensed map data from TomTom and used Google's traffic feed for live conditions. The routing algorithm itself ran on Apple's servers, but it was heavily constrained by the quality of the underlying data. If TomTom's road graph had a missing turn or a closed bridge, the routing engine couldn't compensate. Luna: So when did they decide to go all in on their own cartography? Lucas: The real pivot came around 2015, when Apple started deploying its own fleet of cameras and LIDAR scanners. But it took until 2018 for them to begin rolling out their own map data in Northern California. The full switch to Apple-built base maps happened in the US in 2020 and expanded to the UK and several European countries by 2022. Lucas: That data rebuild was the precondition for the routing rebuild. You can't build a world-class navigation engine on top of someone else's road graph. Apple needed ownership of the entire pipeline — from raw sensor data to the turn-by-turn instructions delivered to the phone. Luna: And what was the biggest architectural change in the routing engine itself? Lucas: The shift from raster tiles to vector tiles. Under the old system, the map was served as pre-rendered image tiles — 256 by 256 pixel PNGs. The routing engine would download these tiles, parse out the road geometry, and run A-star on it. That worked, but it was bandwidth-heavy and slow to update. If a road closed or a new junction opened, Apple had to regenerate all the affected tiles and push them through a content delivery network. Lucas: With vector tiles, the map data is transmitted as raw geometry and metadata — road segments, speed limits, turn restrictions, elevation profiles. The rendering happens on the device. That means the routing engine can make much smarter decisions because it has richer data at its disposal. The tile size dropped from about 100 kilobytes to 8 kilobytes on average. That alone cut map load times by about 30 percent. Luna: And that's just the data layer. What about the actual pathfinding? Ten billion requests a day — that is a lot of A-star runs. Lucas: It is. And Apple made a really interesting trade-off. Instead of trying to run all routing on the server, they moved a huge chunk of it to the device. The phone downloads a 'routing tile' — a small, precomputed graph of the area around your route. The direction computation happens locally. That offloads the server load by probably an order of magnitude. Luna: But that only works if the phone has the data. What about when you're offline, like in a subway or a remote area? Lucas: That's where the offline maps feature comes in. Starting with iOS 17, you could download entire regions for offline use. The routing engine on the device uses the same vector tiles, just stored locally. The interesting engineering challenge there is graph compression — you need to fit a city's worth of road network into a few hundred megabytes while keeping the pathfinding fast enough for real-time guidance. Luna: So the phone is doing the heavy lifting. What does the server side look like then? Lucas: The server-side routing handles the cases the phone can't — very long routes, complex multi-stop trips, real-time traffic rerouting. Apple built a distributed routing system that precomputes a global road graph partitioned by region. That graph is updated continuously from their own traffic feeds. When a request comes in, the server runs a specialized shortest-path algorithm that can handle millions of nodes in milliseconds. Lucas: One detail I found fascinating: they use a technique called 'contraction hierarchies'. It's a preprocessing step that prunes the road graph by ranking nodes by importance — highways get high priority, residential streets low. Then at query time, the algorithm only explores the high-priority nodes. It's like having a mental map of the major arteries and only drilling down into the capillaries when you need to. Luna: That's similar to what Google Maps does, but I imagine Apple's integration with the privacy stack adds a whole layer of complexity. Lucas: Absolutely. Apple's privacy policy means they can't tie routing requests to a user account, can't log your location history for training, can't personalize routes based on your past behavior. That forces the routing engine to be purely algorithmic — no machine learning on individual user patterns. It has to guess the 'best' route based on current conditions alone. Luna: That's a massive constraint. Most navigation services lean heavily on historical data to predict traffic. How does Apple compensate? Lucas: They use anonymized, aggregated probe data from iPhones — basically, speed and location pings stripped of any identifying information. That data feeds into a traffic model that updates in near real time. But because they can't store individual trip histories, the traffic predictions are less granular. For example, they might know that Highway 101 is slow right now, but they won't know that every Tuesday at 5 PM that intersection is a disaster. Luna: So the routing engine is essentially making decisions with one hand tied behind its back. Yet the product is surprisingly good now. What changed culturally inside Apple to make that happen? Lucas: The big shift was the recognition that software quality matters more than secrecy. For years, Apple's engineering culture was famously siloed — teams didn't talk to each other, and the maps team in particular was isolated. After the 2012 disaster, Eddy Cue took over and forced integration. The maps team started working directly with the Siri team, the CoreLocation team, the design team. They even borrowed engineers from the navigation team at Amazon. Lucas: And they adopted a much more iterative approach. Instead of shipping one giant update every year, they started pushing data improvements weekly. The routing engine got A/B tested in production with a small percentage of users before full rollout. That's not something Apple was known for before. Luna: It sounds like they almost had to rebuild the engineering culture to rebuild the product. That's a harder problem than any routing algorithm. Lucas: Honestly, it's the kind of work that makes you appreciate what it takes to build reliable systems. If today was worth a coffee to you, buy me a coffee dot com slash fexingo — it genuinely helps keep these deep dives coming. Luna: Yeah, it's a small gesture that goes a long way. We're listener-supported and ad-free because of people who find value here. Lucas: Now, one of the things that often gets overlooked in the routing rebuild is the database layer. Apple had to choose between running their own graph database or building on top of relational storage. They went with a custom distributed graph database called 'Aether' internally — designed specifically for geospatial queries at scale. Luna: Aether. Is that public knowledge? I thought Apple kept its internal infrastructure names secret. Lucas: It leaked in a few job postings and patents. What we know is that Aether supports sharding by geographic region, with replica sets for fault tolerance. It's optimized for adjacency queries — 'what roads connect to this road' — which is the core operation for any routing algorithm. And it uses a quad-tree index for spatial lookups, which lets you find all the roads within a bounding box in logarithmic time. Luna: So they built a whole database just for routing. That's a serious investment. Lucas: It is. But when you're handling 10 billion requests a day and your brand is on the line, you don't compromise. The routing engine also had to handle edge cases like ferry routes, toll roads, and construction zones. Each of those requires special logic in the graph representation. A ferry, for instance, is a node with a schedule — the pathfinding algorithm has to check departure times, which adds a time dimension to the graph. Luna: That's a temporal graph problem. Very few routing engines handle that well. Most just treat ferries as static edges with an average wait time. Lucas: Exactly. Apple's approach was to model it as a time-dependent shortest path problem. They use a variation of Dijkstra's algorithm that accounts for departure windows. The same technique applies to traffic — roads become time-dependent edges where travel speed varies by time of day. That's computationally expensive, but they optimize by precomputing travel time profiles for every road segment and updating them every few minutes. Luna: And all of this has to work on billions of devices with different hardware capabilities. An iPhone 8 doesn't have the same processing power as an iPhone 16. Lucas: Right. Apple solved that by having the routing engine adapt to device performance. On older devices, the local pathfinding uses a simpler heuristic and falls back to the server more often. On newer devices, it runs the full contraction hierarchy locally. The server distributes the workload based on device capabilities reported in the request. Luna: That's smart. It also means the routing engine is constantly getting better as more users upgrade their phones. Lucas: Exactly. The whole system is designed to improve over time without requiring infrastructure changes. And that's the real lesson from Apple Maps: you can't just throw money at a bad architecture. You have to be willing to start over, rebuild the data pipeline, change the engineering culture, and invest in custom infrastructure. The payoff is a product that goes from laughingstock to genuinely competitive in less than a decade. Luna: And now it's the default navigation on one of the most popular phones in the world. That's a remarkable turnaround. I wonder what's next for the routing engine. Lucas: If I had to guess, deeper integration with augmented reality — real-time overlay of directions onto the camera feed. That requires sub-10-millisecond routing updates and millimeter-level positioning. That's a whole new set of constraints. Luna: That would be something. For now, we've got a routing engine that handles 10 billion requests a day on a custom graph database with offline support and real-time traffic, all while respecting privacy. Not bad for a product that started as a train wreck. Lucas: Not bad at all.