Course map

Project 14

Ride-hailing platform

Geospatial data, real-time matching

Start after Part 8 + topic 210

Key topics 40, 137, 210

Architecture Services

Published reference Uber, "H3: Uber's Hexagonal Hierarchical Spatial Index" (Isaac Brodsky, 27 Jun 2018)

Brief

Riders request trips; nearby drivers are matched; live location tracking; the trip lifecycle; surge-pricing awareness; both apps on flaky mobile networks.

Targets

1M active drivers reporting location every 4 s · match p99 < 3 s · location ingest may be lossy, matching state may not · city-level failure isolation.

Must cover

  • Geospatial lookup — cells and "drivers near me" (→ 210).
  • One driver per trip — a lease-based reservation, no double-assignment (→ 137).
  • Location freshness — staleness bounds on driver positions, and what matching does with stale data (P).
  • Dispatch offer expiry — offer, accept, timeout, re-offer (P).

Design challenges

  1. Geospatial indexing (→ 210): geohash/H3 cells; cell-size trade-off; hot cells at airports (→ 88).
  2. Location ingest: 250k writes/sec, last-write-wins per driver, in-memory store — deliberately not the system of record (→ 87, 129).
  3. Matching: the offer/accept protocol with timeouts; the driver locked while deciding — a reservation with a lease (→ 137).
  4. Trip state machine synchronized across two unreliable mobile clients (→ 46, 40).
  5. Geo-partitioning by city as the scaling and failure-isolation unit (→ 142; → 193 — ahead, Part 12; cells → 212).
  6. The quoted price honored despite surge changes — snapshot at request time (→ 129).

Out of scope

Routing and ETA computation internals (the maps service is external); payments (Project 8).

Search the guide