System Design Notes
Don’t forget to get your copy of Designing Data Intensive Applications the single most important book to read for system design interview prep!

Yelp/Nearby Proximity Service

Yelp or Nearby are proximity servers that let you discover restaurants, theaters, shopping malls and other attractions or events in your vicinity. Such applications also allow you to view or add comments, photos and reviews for these events and places. Let's discuss how such a proximity server is designed.

Requirements Of The System

We will design a basic proximity server that can store information for different events and places and allow users to search for them. When the user performs a search, the service will return a list of places near them.

Functional Requirements

  • Users can create an account. They can login and logout of the account.
  • Users can search all the places and events happening within a given radius of their location.
  • Users can add new places and edit the information, including images and description, of the existing places in the database.
  • Users can add feedback and ratings for the places in the app's database.

Non-functional Requirements

  • System should be highly available.
  • Search should return a list of places with minimum latency.
  • The application will be read-heavy and should be able to support a high number of search requests. The system should be able to handle a load of up to 200 search requests each second.
  • The system should be able to scale to around 400 million places. It should also accommodate a substantial growth in the number of places each year.

What Does The System Store?

Before designing the database schema, we need to plan on what the system will store. The proximity server can support different features. Each feature will correspond to a set of data that the system will store for it.

User Profile Data

Since users can create an account, our proximity server will manage profile data for each of the subscribed users. User profile will carry some basic data, including:

  • User ID
  • Name
  • Email
  • Mobile number
  • POI Profile

For each POI (point of interest) entry in the database, the system will manage some key information, including:

  • Place ID
  • Name
  • Category
  • GPS Location (latitude and longitude)
  • Photo link
  • Description
  • Place Review and Rating

Click here to continue reading this lesson on Medium.