Skip to content

Requirements of Uber's Design

Let’s start with the requirements for designing a system like Uber.

The functional requirements of our system are as follows:

Update driver location: The driver is a moving entity, so the driver’s location should be automatically updated at regular intervals.

Find nearby drivers: The system should find and show the nearby available drivers to the rider.

Request a ride: A rider should be able to request a ride, after which the nearest driver should be notified about the rider’s requests.

Manage payments: At the start of the trip, the system must initiate the payment process and manage the payments.

Show driver estimated time of arrival (ETA): The rider should be able to see the estimated time of arrival of the driver.

Confirm pickup: Drivers should be able to confirm that they have picked up the rider.

Show trip updates: Once a driver and a rider accept a ride, they should be able to constantly see trip updates like ETA and current location until the trip finishes.

End the trip: The driver marks the journey complete upon reaching the destination, and they then become available for the next ride.

The non-functional requirements of our system are as follows:

Availability: The system should be highly available. The downtime of even a fraction of a second can result in a trip failure, in the driver being unable to locate the rider, or in the rider being unable to contact the driver.

Scalability: The system should be scalable to handle an ever-increasing number of drivers and riders with time.

Reliability: The system should provide fast and error-free services. Ride requests and location updates should happen smoothly.

Consistency: The system must be strongly consistent. The drivers and riders in an area should have a consistent view of the system.

Fraud detection: The system should have the ability to detect any fraudulent activity related to payment.

Now, let’s estimate the resources for our design. Let’s assume it has around 500 million riders and about five million drivers. We’ll assume the following numbers for our estimates:

  • We have 20 million daily active riders and three million daily active drivers.

  • We have 20 million daily trips.

  • All active drivers send a notification of their current location every four seconds.

Let’s estimate the storage required for our system:

Let’s assume we need around 1,000 Bytes to store each rider’s information, including ID, name, email, and so on, when the rider registers in our application. To store the 500 million riders, we require 500 GB of storage:

Additionally, if we have around 500,000 new riders registered daily, we’ll need a further 500 MB to store them.

Let’s assume we need around 1,000 Bytes to store each driver’s information, including ID, name, email, vehicle type, and so on, when the driver registers in our application. To store the five million drivers, we require 5 GB of storage:

Additionally, if we have around 100,00 new drivers registered daily, we’ll need around 100 MB to store them.

Let’s assume we need around 36 Bytes to store the driver’s location updates. If we have five million drivers, we need around 180 MB of storage just for the drivers’ locations.

Let’s assume we need around 100 Bytes to store single trip information, including trip ID, rider ID, driver ID, and so on. If we have 20 million daily rides, we need around 2 GB of storage for the trip data.

Let’s calculate the total storage required for Uber in a single day:

Note: We can adjust the values in the table to see how the estimations change.

We’ll only consider drivers’ location updates and trip data for bandwidth calculation since other factors don’t require significant bandwidth. We have 20 million daily rides, which means we have approximately 232 trips per second.

Now, each trip takes around 100 Bytes. So, it takes around 23 KB per second of bandwidth.

As already stated, the driver’s location is updated every four seconds. If we receive the driver’s ID (3 Bytes) and location (16 Bytes), our application will take the following bandwidth:

These bandwidth requirements are modest because we didn’t include bandwidth needs for maps and other components that are present in the real Uber service.

Note: We can adjust the values in the table to see how the requirements change.

We’ve ignored the bandwidth from the Uber service to users because it was very small. More bandwidth will be required for sending map data from the Uber service to users, which we’ve also discussed in the Google Maps chapter.

We need to handle concurrent requests coming from 20 million daily active users. We’ll use the following formula to estimate a pragmatic number of servers. We established this formula in the Back-of-the-envelope Calculations chapter:

Note: We can adjust the values in the table to see how the estimations change.

The design of Uber utilizes the following building blocks:

  • Databases store the metadata of riders, drivers, and trips.

  • A cache stores the most requested data for quick responses.

  • CDNs are used to effectively deliver content to end users, reducing delay and the burden on end-servers.

  • A load balancer distributes the read/write requests among the respective services.

Riders’ and drivers’ devices should have sufficient bandwidth and GPS equipment for smooth navigation with maps.

Note: The information provided in this chapter is inspired by the engineering blog of Uber.

System Design: UberHigh-level Design of Uber