Architecture gallery › Uber dispatch
Uber-style ride dispatch architecture
How a ride-hailing dispatch system matches riders with nearby drivers in real time - location ingestion, a geospatial index, matching, ETA and pricing.
Open and edit this diagramStart from a blank canvas

How it works
A ride-hailing platform is a real-time marketplace. Drivers send their location every few seconds, riders ask for a trip, and the dispatch system has to match them within moments while staying correct when thousands of requests arrive at once.
The enabling trick is a geospatial index that buckets the world into cells (Uber open-sourced H3 for this). Finding nearby drivers becomes a lookup of a handful of cells instead of a scan of every driver. Matching, ETA and pricing then work on that small candidate set.
Step by step
- Driver apps stream location updates to the location service, which writes them into the geospatial index.
- A rider requests a trip through the API gateway. Dispatch asks the geo index for nearby available drivers.
- ETA and pricing estimate the pickup time and fare for each candidate using a maps provider.
- Dispatch offers the trip to the best driver through push notifications. On accept, the trip service records the trip.
- When the trip ends the trip service triggers payment and publishes trip events for analytics.
The YAML behind this diagram
Every diagram here is plain text. Paste it into ArchSketch (menu → Diagram from YAML) to edit it, or keep it in your repo next to the code.
nodes:
- { id: rider, kind: mobile, label: Rider app }
- { id: driver, kind: mobile, label: Driver app }
- { id: gw, kind: gateway, label: API gateway }
- { id: loc, kind: service, label: Location service, zone: Dispatch platform }
- { id: geo, kind: cache, label: Geo index (H3 cells), zone: Dispatch platform }
- { id: dispatch, kind: service, label: Dispatch / matching, zone: Dispatch platform }
- { id: eta, kind: ml, label: ETA & pricing, zone: Dispatch platform }
- { id: trips, kind: service, label: Trip service, zone: Trips & payments }
- { id: tripdb, kind: sql, label: Trips DB, zone: Trips & payments }
- { id: pay, kind: payment, label: Payments, zone: Trips & payments }
- { id: push, kind: notify, label: Push notifications }
- { id: maps, kind: external, label: Maps provider }
- { id: kafka, kind: stream, label: Trip events }
links:
- driver -> gw : location pings
- rider -> gw : request ride
- gw -> loc
- loc -> geo : update cell
- gw -> dispatch
- dispatch -> geo : nearby drivers
- dispatch -> eta
- eta -> maps : routes
- dispatch -> push : offer trip
- push -> driver
- dispatch -> trips : accepted
- trips -> tripdb
- trips -> pay : charge
- trips -> kafka
Use it in your README
Commit your own arch.yaml and embed the always-up-to-date picture:
