2

I was curious about what system design possibly Uber uses for sending new trips to Drivers. The new trip requests keep popping up on the phone of Uber drivers. The things to consider would be :-

  • Are the requests sent by splitting by locality of the requests ?
  • Do they use a permanent open unidirectional socket connection ?
  • Or does the application keep querying the database ?

It would also be helpful if someone could give example of libraries which can achieve similar architecture using a nodejs server and android application frontend (current preferences).

2 Answers2

2

I used to be a software engineer at Uber. That was a long time ago, but I think I can answer your questions:

  1. Ride requests from riders to drivers are sharded by the rider's city. The matching algorithm does not need to consider drivers in other parts of the world.

  2. In the old days, the Uber driver and rider apps polled the server every 4 seconds or so. The server receives new GPS locations for the rider and driver and send back state updates. Nowadays, the Uber apps rely on persistent TCP connections--but polling is an important fallback when mobile networks are unreliable.

  3. As far as I remember, the driver and rider apps don't have to continually query our on-disk databases every few seconds during a ride. That sort of information is generally cached in-memory until the ride is over.

James Mishra
  • 4,249
  • 4
  • 30
  • 35
1

To get a definitive answer you'll have to get someone from Uber to answer your question, otherwise all we can do is speculate based on what we believe is best practice / makes sense.

That said, there is a bunch of articles online that talk about how Uber is built, a cursory search provides links such as these:

  1. UBER system design
  2. Uber Architecture and System Design

I can't vouch for the quality of these articles (the first one's author has also done a video - link in the article), but at first glance they look pretty good as they seem to go into some depth and look like they will (probably) cover the questions your asking.

Adrian K
  • 9,880
  • 3
  • 33
  • 59