Problem
A ride-hailing service sometimes has demand many times above supply: a concert lets out, it rains, a mass event ends. Cars are not available, and assignment turns into a lottery for whoever has a driver freed nearby first. Users do not know how long to wait, so they place several orders at once (multi-orders) or cancel and re-order, often at a higher price because the surge coefficient rose meanwhile. This also loads the backend microservices.
Example from the article: after a concert at a stadium, hundreds or thousands of people order a taxi in the same area, and the search takes 10 seconds, 1 minute, 3 minutes.
Solution in brief
In the Economy tariff, a virtual queue turns on when many orders nearby wait long for a driver. The user sees a live queue number instead of an ETA. In assignment, each order-driver edge weight gets a bonus term for queue position, so earlier orders get drivers first. The queue state lives in a Redis index per zone and tariff.
Questions this case answers
- How to give earlier requests priority in a buffered two-sided matching system during a short demand spike
- How to decide in real time whether a local demand spike calls for queueing, using the waiting time of neighboring requests
- How to test only the user-facing interface of a change when its backend effect was already measured
- How to keep a ride-hailing service predictable when demand briefly exceeds supply many times over?
Tools and methods
- Buffered dispatch with bipartite matching — edges weighted by driver travel time and distance, solved with the Hungarian algorithm.
- Edge weight bonus — turns queue position into priority.
- Redis Cluster with Lua scripts — order index per (zone, tariff) with queue position.
- User-level A/B test — measures the reaction to the queue interface.
Google or a one-time email code. No password.
