Design Google Maps
Learn to design a map system similar to Google maps.
Overview
A maps application (like Google Maps or Apple Maps) enables users to find the best possible path to the required destination based on vehicle type and traffic. It also provided the time required.
When do we use a maps service?
Individuals and organizations rely on location data to navigate around the world. Maps help in these cases:
- Individuals can find the locations of and directions to new places quickly, instead of wasting their time and the costs of travel, such as gas.
- Individuals use maps to see their estimated time of arrival (ETA) and the shortest path based on current traffic data.
- Many modern applications rely heavily on maps, such as ride-hailing services, autonomous vehicles, and hiking maps. For example:
- Waymo’s self-driving car system uses Google Maps to navigate efficiently, quickly, and safely.
- Uber uses Google Maps as part of its application to assist drivers and provide customers with a visual representation of their journey.
- Routing and logistics-based companies reduce the time it takes to make deliveries. By using a map’s unique real-time and historical traffic data, it minimizes the overall cost of deliveries by reducing gas usage and time spent stuck in traffic.
In 2022, more than five million businesses are using Google Maps. It provides an API for enterprises to use a map system in their application.
Requirements
Before we start requirements, let’s clarify that we will design a system like Google Maps by picking a few key features because actual Google Maps is feature-rich and complex.
Let’s list the functional and non-functional requirements of the system under design.
Functional requirements
The functional requirements of our system are as follows.
- Identify the current location: Users should be able to approximate their current location (latitude and longitude in decimal values) on the world map.
- Recommend the fastest route: Given the source and destination (place names in text), the system should recommend the optimal route by distance and time, depending on the type of transportation.
- Give directions: Once the user has chosen the route, the system should list directions in text format, where each item in the list guides the user to turn or continue in a specific direction to reach the destination.
Non-functional requirements
The non-functional requirements of our system are as follows.
- Availability: The system should be highly available.
- Scalability: It should be scalable because both individuals and other enterprise applications like Uber and Lyft use Google Maps to find appropriate routes.
- Less response time: It shouldn’t take more than two or three seconds to calculate the
and the route, given the source and the destination points.ETA Estimated Time of Arrival
Note: We’re not getting into the details of how we get the data on roads and layout. Government agencies provide maps, and in some places, Google itself drives mapping vehicles to find roads and their intersection points. Road networks are modeled with a graph data structure, where intersection points are the vertices, and the roads between intersections are the weighted edges.
Challenges
Some of the challenges that we need to focus on while designing a system like Google Maps are below:
- Scalability: Serving