Design Considerations in Yelp
Look into the different design aspects of Yelp in more detail.
Introduction
We discussed the design, components, and workflow of our system in the previous lesson, and a number of interesting questions need answering. For example, what approach do we use to find the places, or how do we rank places based on their popularity? This lesson answers such important design concerns. The table below summarizes the goals of this lesson.
Summary of the Lesson
Section/Sub-section | Purpose |
Searching | Divide the world into segments to optimize searching to identify nearby sites in a given location and radius |
Storing indexes | Index the places to improve query performance and estimate the storage required for indexes |
Searching using segments | Search the desired places by combining the segments |
Dynamic segments | Solve the static segments limitations using Dynamic segments |
Searching using QuadTree | Explore the searching using QuadTree |
Space estimations for QuadTree | Estimate the storage for QuadTree |
Data Partitioning | Look into the options we can use to partition the data |
Ensuring availability | How we will ensure the availability of the system |
Inserting a new place | How to insert the place in QuadTree |
Ranking popular places | Rank the places of the system |
Evaluation | Evaluate how our system fulfills the non-functional requirements |
Searching
From Google maps, we were able to connect segments and meet the scalability challenge to process a large graph efficiently. The graph of the world had numerous nodes and vertices, and traversing them was time-consuming. So, we divided the whole world into smaller segments/subgraphs to process and query them in parallel. The segmentation helps in improving the scalability of the system.
Each segment will be of size and have a list of places in it that exist within it. We can search only a few segments to locate close destinations. To identify nearby sites, we can use a given location and radius to find all nearby segments.
Food for thought!
If we create a table for storing all places, how will we find nearby places?
We can store all places in a table and uniquely identify a segment by having a segment_ID
. We can index each segment in the database (see next section for details). Now we have limited the number of segments we need to search so the query will be optimized and return results quickly.
Improving data fetching
We will use a key-value store for quick access to the places in the segments. The key will be the segment_ID
while value
will have the list of places in that segment. Let’s estimate how much space we will need to store the indexes.
We can usually store a few MBs in the value of the key-value store. If we assume that each segment has 500 places then it will take up and we can easily ...
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy