Ethan's Blog


  • Home

  • Archives

  • Tags

  • Search

Designing Ticketmaster

Posted on 2021-02-28

What is an Online Movie Ticket Booking System?

A movie ticket booking system provides its customers the ability to purchase theatre seats online. E-ticketing systems allow the customers to browse through movies currently being played and to book seats, anywhere anytime.

Requirements and Goals of the System

Our ticket booking service should meet the following requirements:
Functional Requirements:

  1. Our ticket booking service should be able to list different cities where its affiliate cinemas are located;
  2. Once the user selects the city, the service should display the movies released in that particular city;
  3. Once the user selects a movie, the service should display the cinemas running that movie and its available showtimes;
  4. The user should be able to choose a show at a particular cinema and book their tickets;
  5. The service should be able to show the user the seating arrangement of the cinema hall. The user should be able to select multiple seats according to their preference;
  6. The user should be able to distinguish available seats from booked ones;
  7. Users should be able to put a hold on the seats for five minutes before they make a payment to finalize the booking;
  8. The user should be able to wait if there is a chance that the seats might become available, e.g., when holds by other users expire;
  9. Waiting customers should be serviced in a fair, first come, first serve manner;

Non-Functional Requirements:

  1. The system would need to be highly concurrent. There will be multiple booking requests for the same seat at any particular point in time. The service should handle this gracefully and fairly;
  2. The core thing of the service is ticket booking, which means financial transactions. This means that the system should be secure and the database ACID compliant;
Read more »

Designing Uber backend

Posted on 2021-02-27

What is Uber?

Uber enables its customers to book drivers for taxi rides. Uber drivers use their personal cars to drive customers around. Both customers and drivers communicate with each other through their smartphones using the Uber app.

Requirements and Goals of the System

Let’s start with building a simpler version of Uber.
There are two types of users (Drivers, Customers) in our system:

  • Drivers need to regularly notify the service about their current location and their availability to pick passengers;
  • Passengers get to see all the nearby available drivers;
  • Customer can request a ride; nearby drivers are notified that a customer is ready to be picked up;
  • Once a driver and a customer accept a ride, they can constantly see each other’s current location until the trip finishes;
  • Upon reaching the destination, the driver marks the journey complete to become available for the next ride;

Capacity Estimation and Constraints

  • Let’s assume we have 300M customers and 1M drivers with 1M daily active customers and 500K daily active drivers;
  • Let’s assume 1M daily rides;
  • Let’s assume that all active drivers notify their current location every three seconds;
  • Once a customer puts in a request for a ride, the system should be able to contact drivers in real-time;
Read more »

Designing Yelp or Nearby Friends

Posted on 2021-02-27

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.

Requirements and Goals of the System

What do we wish to achieve from a Yelp like service? Our service will be storing information about different places so that users can perform a search on them. Upon querying, our service will return a list of places around the user.
Our Yelp-like service should meet the following requirements:
Functional Requirements:

  1. Users should be able to add/delete/update places;
  2. Given their location (longitude/latitude), users should be able to find all nearby places within a given radius;
  3. Users should be able to add feedback/review about a place. The feedback can have pictures, text, and a rating;

Non-Functional Requirements:

  1. Users should have a real-time search experience with minimum latency;
  2. Our service should support a heavy search load. There will be a lot of search requests compared to adding a new place;
Read more »

Designing Facebook's Newsfeed

Posted on 2021-02-26

What is Facebook’s Newsfeed?

A Newsfeed is the constantly updating list of stories in the middle of Facebook’s homepage. It includes status updates, photos, videos, links, app activity, and “likes” from people, pages, and groups that a user follows on Facebook. In other words, it is a compilation of a complete scrollable version of your friends’ and your life story from photos, videos, locations, status updates, and other activities.
For any social media site you design - Twitter, Instagram, or Facebook - you will need a newsfeed system to display updates from friends and followers.

Requirements and Goals of the System

Let’s design a newsfeed for Facebook with the following requirements:
Functional Requirements:

  1. Newsfeed will be generated based on the posts from the people, pages, and groups that a user follows;
  2. A user may have many friends and follow a large number of pages/groups;
  3. Feeds may contain images, videos, or just text;
  4. Our service should support appending new posts as they arrive to the newsfeed for all active users;

Non-Functional Requirements:

  1. Our system should be able to generate any user’s newsfeed in real-time - maximum latency seen by the end user would be 2s;
  2. A post shouldn’t take more than 5s to make it to a use’s feed assuming a new newsfeed request comes in;
Read more »

Designing a Web Crawler

Posted on 2021-02-26

What is a Web Crawler?

A web crawler is a software program which browses the World Wide Web in a methodical and automated manner. It collects documents by recursively fetching links from a set of starting pages. Many sites, particularly search engines, use web crawling as a means of providing up-to-date data. Search engines download all the pages to create an index on them to perform faster searches.
Some other uses of web crawlers are:

  • To test web pages and links for valid syntax and structure;
  • To monitor sites to see when their structure or contents change;
  • To maintain mirror sites for popular Web sites;
  • To build a special-purpose index, e.g., one that has some understanding of the content stored in multimedia files on the Web;

Requirements and Goals of the System

Let’s assume we need to crawl all the web:

  • Scalability: Our service needs to be scalable such that it can crawl the entire Web and can be used to fetch hundreds of millions of Web documents;
  • Extensibility: Our service should be designed in a modular way with the expectation that new functionality will be added to it. There could be newer document types that need to be downloaded and processed in the future;
Read more »
1…161718…55
necusjz

necusjz

271 posts
16 tags
© 2016 - 2026 necusjz
Powered by Hexo
Theme - NexT.Mist