androidwebsocketarchitectureuber-api

How does Uber send new ride requests to drivers?


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 :-

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).


Solution

  • 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.