Files
system-design-101/data/guides/design-google-maps.md
Kamran Ahmed ee4b7305a2 Adds ByteByteGo guides and links (#106)
This PR adds all the guides from [Visual
Guides](https://bytebytego.com/guides/) section on bytebytego to the
repository with proper links.

- [x] Markdown files for guides and categories are placed inside
`data/guides` and `data/categories`
- [x] Guide links in readme are auto-generated using
`scripts/readme.ts`. Everytime you run the script `npm run
update-readme`, it reads the categories and guides from the above
mentioned folders, generate production links for guides and categories
and populate the table of content in the readme. This ensures that any
future guides and categories will automatically get added to the readme.
- [x] Sorting inside the readme matches the actual category and guides
sorting on production
2025-03-31 22:16:44 -07:00

46 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Design Google Maps"
description: "Learn how to design a simplified version of Google Maps."
image: "https://assets.bytebytego.com/diagrams/0207-google-maps.png"
createdAt: "2024-03-09"
draft: false
categories:
- how-it-works
tags:
- "System Design"
- "Maps"
---
![](https://assets.bytebytego.com/diagrams/0207-google-maps.png)
Google started project **Google Maps** in 2005. As of March 2021, Google Maps had one billion daily active users, 99% coverage of the world.
Although Google Maps is a very complex system, we can break it down into 3 high-level components. In this post, lets take a look at how to design a simplified Google Maps.
## Location Service
The location service is responsible for recording a users 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.
## Map Rendering
The worlds 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 dont 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.
## Navigation Service
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 doesnt want to avoid tolls.