Design of Yelp
Define the detailed architecture for a proximity service like Yelp. Explore the necessary API design for search and data entry, and structure the storage schema using relational and key-value databases. Learn how specialized components like quadtree servers and aggregators handle complex geospatial search requests efficiently.
We'll cover the following...
Following the requirements and estimations from the previous lesson, we will now focus on the API design, storage schema, and system building blocks.
API design
This section outlines the API endpoints for the system.
Search
The search function locates places based on categories (e.g., “cafes” ):
search(category, user_location, radius)
Parameter | Description |
| This is the type of search the user makes, for example, a search for restaurants, cinemas, cafes, and so on. |
| This contains the location of the user who’s searching with Yelp. |
| This is the specified radius where the user is trying to find the required category. |
Returns a JSON object listing items in the category within the specified radius. Each entry includes the place name, address, category, rating, and thumbnail.
To search for a specific place by name (e.g., “Burger Hut” ):
search(name_of_place, user_location, radius)
Parameter | Description |
| This contains the name of the place that the user wants to search for. |
Returns a JSON object containing details of the specified place.
Add a place
To add a new place:
add_place(name_of_place, description_of_place, category, latitude, longitude, photo}
Parameter | Description |
| This contains the name of the place, for example, "Burger Hut". |
| This contains a description of the place. For example, "Burger Hut sells the yummiest burgers". |
| This specifies the category of the place—for example, "cafe". |
| This tells us the latitude of the place. |
| This tells us the longitude of the place. |
| This contains photos of the place. There can be a single or multiple photos. |
Returns a confirmation of the addition or an error message.
Add a review
To add a review:
add_review(place_ID, user_ID, review_description, rating)