Detailed Design of Google Maps
Let's dig into the detailed design of the maps system.
In this lesson, we will discuss our detailed design by answering the following key questions:
- How do user requests benefit from segments?
- How do we improve the user experience by increasing the accuracy of ETAs?
Segment setup and request handling
This section will describe how the segment data is stored in the database and how user requests are handled using the already stored data.
Starting with the database schema, we will discuss how the segments are added and hosted on the servers and also how the user requests are processed.
Database schema
We store the following information for each segment.
Key-value store:
ID
of the segment.ServerID
on which the segment is hosted- In reality, each segment is a polygon, so we store boundary
coordinates
(latitude/longitude), possibly a list. - A list of segment IDs of the
neighbor
segments.
Graph DB
- The road network inside the segment in the form of a
graph
.
Relational DB
We store the information whether at a particular hour of the day there is congestion (for example due to a rush hour) or not on a road that later helps us decide whether to update the graph (weights) based on ...
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy