G𝐨𝐨𝐠π₯𝐞 M𝐚𝐩𝐬

Google started project G𝐨𝐨𝐠π₯𝐞 M𝐚𝐩𝐬 in 2005. As of March 2021, Google Maps had one billion daily active users, 99% coverage of the world in 200 countries.

Although Google Maps is a very complex system, we can break it down into 3 high-level components. In this post, let’s take a look at how to design a simplified Google Maps.

π‹π¨πœπšπ­π’π¨π§ π’πžπ«π―π’πœπž
The location service is responsible for recording a user’s location update. The Google Map clients send location updates every few seconds. The user location data is used in many cases:

- detect new and recently closed roads.
- improve the accuracy of the map over time.
- used as an input for live traffic data.

𝐌𝐚𝐩 π‘πžπ§ππžπ«π’π§π 
The world’s map is projected into a huge 2D map image. It is broken down into small image blocks called β€œtiles” (see below). The tiles are static. They don’t change very often. An efficient way to serve static tile files is with a CDN backed by cloud storage like S3. The users can load the necessary tiles to compose a map from nearby CDN.

What if a user is zooming and panning the map viewpoint on the client to explore their surroundings?

An efficient way is to pre-calculate the map blocks with different zoom levels and load the images when needed.

𝐍𝐚𝐯𝐒𝐠𝐚𝐭𝐒𝐨𝐧 π’πžπ«π―π’πœπž
This component is responsible for finding a reasonably fast route from point A to point B. It calls two services to help with the path calculation:

1️⃣ Geocoding Service: resolve the given address to a latitude/longitude pair.
2️⃣ Route Planner Service: this service does three things in sequence:

β€” Calculate top-K shortest paths between A and B
β€” Calculate the estimation of time for each path based on current traffic and historical data
β€” Rank the paths by time predictions and user filtering. For example, the user doesn’t want to avoid tolls.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store