0% completed
Designing Yelp or Nearby Friends
1. Why Yelp or Proximity Server?
Proximity servers are used to discover nearby attractions like places, events, etc. If you haven’t used yelp.com before, please try it before proceeding (you can search for nearby restaurants, theaters, etc.) and spend some time understanding different options that the website offers. This will help you a lot in understanding this chapter better.
Try it yourself
Before looking at the solution, try designing it:
Designing Yelp (video)
Here is a video discussing how to design Yelp or Proximity Server:
.....
.....
.....
Junaid Effendi
· 4 years ago
The idea behind data sharding and LB is almost same in these chapters.
My question is: Why LB is always saying more intelligent solution rather than naming a good solution, like consistent hashing on ip may be?
Second even hash on LocationID would need consistent hashing, if you have 10 static servers we can do LocationID % 10, but what if server size increases?
In either one: a. Sharding based on regions b. Sharding based on LocationID
The end goal is consistent hashing.
Krispy Donut
· 5 years ago
how did we get 500K with 4 bytes? Using base 64, we should get about 16K ids.
Krispy Donut
· 5 years ago
Search is off course primary API, but a post API would also be necessary to create/update places.
Sam
· 4 years ago
When we talk about "partitioning the QuadTree", are we talking about actually storing different nodes in the tree on different servers? If yes, what would be a good way to decide which nodes are stored on the same server? I feel "sharding based on location id" is kinda confusing, because location ids will only appear on leaf nodes, right?
Junaid Effendi
· 4 years ago
Some chapters uses mysql as a db, I wonder how would it it scale to support since it does not support horizontal scaling, is nosql the end goal to achieve scalability.
User
· 4 years ago
How is the correct path chosen through the quad tree for a user's location if the internal nodes are just storing pointers to its 4 children and doesn't include location information about its children?
Surbhi Goel
· 4 years ago
How is the index size for fixed size grid (4 * 20M) + (8 * 500M) ~= 4 GB Shouldn't it be (4 * 20M) + ((8+8)* 500M) to include both longitude and latitude?
francesco.perna90
· 4 years ago
I don't understand how we set grid size.
"Grid size could be equal to the distance we would like to query since we also want to reduce the number of grids".
The distance "we would like to query" is the radius ?
Thanks.
George
· 4 years ago
How is a quad tree persisted/stored? Is the search done directly on a DB (if yes, an example would be great) or is it more like each servers builds a quadtree and keeps it in its memory on set up?
Furquan Amanat
· 5 years ago
In yelp design, I am unable to understand the Grid system. How does the logic knows Grid from the Long and Lat. When I look at the Query "Select * from Places where Latitude between X-D and X+D and Longitude between Y-D and Y+D and GridID in (GridID, GridID1, GridID2, ..., GridID8)" What I dont understand is how does GridID is being retrieved. Is that in the table for Long and Lat or some other way, I will appreciate an explanation in terms of how do System know the Grid when looking a specific Long and Lat location given that I dont see any relation between them from table structure or any other way