Let's say Uber matched you with a driver named Allen. First thing is, Allen's phone never talks to your phone directly. Everything has to go through Uber's servers.
So let's follow how the location from Allen's phone reaches your phone.
- The Location Worker: On Allen's phone, the driver app runs a small location worker. This worker reads the GPS and, once every four seconds, uploads Allen's location to Uber's location service. Every trip does the same, so Uber receives tens of billions of locations each day.
- Kafka Streaming: Your app isn't the only one needing Allen's location. Uber uses it for arrival times, traffic measurement, and emergencies. Instead of sending the same location to each service separately, Uber streams updates through Kafka. The location is published once, and any service can read it independently.
- Map Matching: The raw GPS location can't be shown as-is. Between tall buildings, GPS can be wrong by 50 meters or more, making Allen's car appear inside a building. To fix this, Uber compares GPS readings with its own road network to determine which road Allen is actually on. This process is called map matching.
- Push vs. Polling: Your phone could keep asking Uber for the latest location (polling), but with millions of phones, this created a huge number of unnecessary requests. At one point, 80% of requests reaching Uber's API gateway were polling requests. So Uber moved to a push-based system.
- Fireball: An event-driven service. Every time Uber calculates Allen's corrected location, it publishes an event. Fireball listens for these events, decides if an update is needed, and determines who should receive it. Since Allen is your driver, Fireball calls the API Gateway.
- API Gateway: This service answers what to send. It collects the latest trip information, like Allen's location and your arrival time, and prepares the message.
- Ramen: The message is handed over to Ramen to complete the delivery to your phone.

Contact Us
Sign up / Log in
Not interested
Flag