...

/

Uber Design clone

Uber Design clone

Understand the high-level and detailed design of the Uber system.

Workflow of our application

Before diving deep into the design, let’s first understand how our application works with the help of workflow. The following steps show the working of our application.

  1. All the nearby drivers except those already serving rides can be seen when the rider starts our application.

  2. The rider enters the dropoff location and requests a ride.

  3. The application receives the request and finds a suitable driver.

  4. Until a matching driver is found, the status will be “waiting for the driver to respond.”

  5. On the other hand, the drivers report their location every 4 seconds. The application finds the trip information and returns it to the driver.

  6. The driver accepts or rejects the request.

    6.1 The driver accepts the taxi request. Modify the status information on both rider’s and driver’s applications. The rider finds that he is successfully matched and obtains the driver’s information.

    6.2 The driver refuses the ride request. Restart from step 2 and rematch a driver.

High-level design

At a high level, our system should be able to take requests for a ride from the rider and return the matched driver information and trip info to the rider. It also regularly takes the driver’s location and returns the trip and rider information to the driver when the driver is matched to a rider.

API design

Let’s understand the design of APIs in terms of the functionalities we are providing. We will design APIs to translate our feature set into technical specifications.

In the following APIs, we will not repeat the description of repeating parameters.

Update driver location

updateDriverLocation(driverID, oldlat, oldlong, newlat, newlong )
  • driverID: The ID of the driver.
  • oldlat: Previous latitude of the driver.
  • oldlong: Previous longitude of the driver.
  • newlat: New latitude of the driver.
  • newlong: New longitude of the driver.

This API is used to send the driver’s coordinates to the driver location servers where the location of the driver is updated and communicated to the riders.

Find nearby drivers

findNearbyDrivers(riderID, lat, long)
  • riderID: The ID of the rider for whom we want to find the nearby drivers.
  • lat: Latitude of the rider.
  • long: Longitude of the rider.

This API is used to send the location information of the rider for whom we want to find the nearby drivers.

Request a ride

requestRide(riderID, lat, long, dropOfflat,dropOfflong, typeOfVehicle)
  • lat: Current latitude of the rider.
  • long: Current longitude of the rider.
  • dropOfflat: Latitude of the
...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy