techdiagrams.net
← All templates

Ride-hailing dispatch

Real-time rider–driver matching: GPS pings stream through competing consumers into a geospatial index, presence tracks who's really online, and surge pricing closes the loop.

Open in editor — free, no login Download JSON
FRESHNESS PIPELINE — THE MATCH IS ONLY AS GOOD AS THISrequest ridek-nearest in cell 8a2really available?×1.4 multiplieroffer to driveroffer ⇄ acceptGPS pingsupdate cellswindowed demand/supplyheartbeatsRider Apprequest rideRider Gatewayheld connectionSurge Pricerdemand/supply per cellMatch Servicek-nearest in cellGeo IndexH3 cells · driver positionsPresenceheartbeats · availabilityLocation StreamGPS pings · 40k/sLocation Workerscompeting consumers ×12Driver Gatewayoffers out · GPS inDriver Appaccept / declinewhy competing consumers:40k pings/s, any worker may take any ping —add workers to scale, lose one andnothing is waiting on it

What this design does

Matching a rider to a driver is a freshness problem: the answer is only right if the geo index knows where every driver was two seconds ago. Here GPS pings flow through a stream consumed by competing workers into an H3-cell index, presence separates 'connected' from 'actually available', and a surge calculator watches the same stream to price supply against demand. The match itself is then a cheap k-nearest lookup — all the hard work happened before the request arrived.

The patterns it composes

Import it, attach your own numbers, and verify the design against failures — or read the engineering notes.