System Design Lab
Ride matching is bound by ingesting high-frequency driver GPS and answering nearest-driver queries fast, not by request volume.
Tune how many drivers are online, how often each one reports GPS, the ride-request rate, the search radius, and how many cities you serve. The design moves from one service to a dedicated location-ingest path, an in-memory geospatial index for nearest-driver queries, a durable trip-state store, and per-geo sharding with surge pricing.
Guided walkthrough
Reason about it one step at a time
Takeaway
Normal evolution scenarios
Click left to right for the intended demo path. Each card changes the workload inputs.
Recommended shape
Bottlenecks
Why this changes
Decision tradeoffs
Source-backed rules
These are the durable system-design claims behind the model. The exact slider thresholds are deliberately labeled as teaching assumptions.
Uber matches riders to drivers using S2 geospatial cells
Uber indexes the world with hierarchical cells (H3, building on Google S2) so nearest-driver lookups become bounded scans over a small set of cells.
Uber EngineeringGeohashing turns proximity search into prefix range scans
Encoding lat/long as a geohash lets nearby points share a prefix, so a radius query becomes a small set of in-memory sorted-set range reads.
Redis DocsHigh-frequency location ingest is a write-heavy streaming problem
A continuous flood of per-driver GPS events is best absorbed by a partitioned log that decouples ingest from the index and downstream consumers.
Apache KafkaQuadtrees answer 2D nearest-neighbour queries efficiently
A quadtree recursively subdivides space so a region query only visits the cells that overlap the search area instead of every point.
WikipediaTeaching assumptions
- Location ingest write rate is modeled as active drivers times GPS update frequency; real systems batch and dedup updates.
- Single-node ingest, geo-query, and trip-state budgets are conservative teaching numbers, not vendor limits.
- Geo-query cost grows with search radius and cell density; the in-memory index memory scales with active drivers.