Ride Sharing — Matching and Location Tracking

Ride Sharing — Matching and Location Tracking An architecture diagram generated by Archify. Rider app · request ride · Architecture component Rider app request ride Driver app · GPS every 4 s · Architecture component Driver app GPS every 4 s Gateway · auth, WebSocket · Architecture component Gateway auth, WebSocket Location service · ingest updates · Architecture component Location service ingest updates Geo index · H3 cell → drivers · Architecture component Geo index H3 cell → drivers Dispatch · find + offer · Architecture component Dispatch find + offer Trip service · state machine · Architecture component Trip service state machine Trip store · trips, ledger · Architecture component Trip store trips, ledger Pricing · ETA, surge · Architecture component Pricing ETA, surge request match location update cell nearby quote assign persist Legend Frontend Backend Database Security

Location

  • • Millions of updates per second
  • • In-memory geo index keyed by H3 cells

Dispatch

  • • k-ring search around the rider's cell
  • • Offer to one driver, time out, try next

Trips

  • • Trip lifecycle as a state machine
  • • Pricing uses supply and demand per cell