Back to sketch

SYSTEM DESIGN SKETCHBOOK / PRACTICE SHEET / NO. 27

Design live driver tracking and ETA for a ride

Advanced · 40 min · Real-time delivery

Once a driver accepts, the rider watches the car move toward them on a map with "arriving in 4 min". During the trip both see progress toward the destination and an updated arrival time. Phones lose signal in tunnels and parking garages all the time.

Requirements

  • The driver app reports its location while heading to pickup and during the trip.
  • The rider sees the driver's position on the map, a few seconds behind reality at most.
  • Show ETA to pickup, then ETA to destination, updated as traffic and the driver's route change.
  • After either phone reconnects, the rider sees the current position quickly rather than a replay of old points.

Constraints and assumptions

  • 1 million concurrent active trips at peak.
  • Drivers send a GPS fix every 4 seconds during a trip (about 250,000 updates per second); each update is about 100 bytes.
  • The rider's map should lag the driver by no more than 5 seconds; the ETA should refresh at least every 30 seconds.
  • Mobile connections drop for 10 to 60 seconds at a time; the driver app should not upload more often than once every 4 seconds to save battery and data.
  • A routing engine with live traffic exists; one route computation costs about 20 ms of CPU.

Out of scope for the first sketch

Matching drivers to riders · Pricing · Turn-by-turn navigation for the driver · Building the road graph and traffic model

Draw your design

Rough math and notes

Done on paper? Compare with the worked approaches