DesignTheSystem/dev
HARD Geospatial & Mobility

Design Ride-Sharing Driver Matching

Handle 40,000 RPS (50% real-time location updates, 50% match requests). Isolate volatile ephemeral state from durable relational data.

Category & DifficultyGeospatial & Mobility · HARD
Traffic Profile40,000 RPS sustained, 64,000 RPS spike (50% reads / 50% writes)
Latency & Availability SLAp99 < 100 ms · 99.99% availability
Monthly Infra Budget$950/month

Scale, traffic & SLA targets

To pass in the DesignTheSystem simulator, your architecture must hold all four targets simultaneously across a 60-second load run (spiking up to 64,000 RPS):

Peak traffic40,000 RPS50% reads / 50% writes
Latency (p99)< 100 ms99th percentile target
Availability99.99%Max error rate 0.01%
Monthly budget$950/moPriced per component

Functional & non-functional requirements

Functional scope

  • Serve Ride-Sharing Driver Matching at the traffic below.

Non-functional goals

  • p99 latency under 100 ms at the spike.
  • At least 99.99% of requests answered.
  • Costs no more than $950 a month.

Core challenge: Live positions, not a history

Drivers send a position every few seconds and riders ask 'who is near me'. Keep the latest positions in memory with a geo index; only trips need durable storage.

What breaks first?

Run the starting design first and look at what breaks. Rides DB reaches 800% of its capacity at the spike, and Location & Dispatch API 405%. About 72% of requests fail. Open Full metrics to see which requests pile up there, and ask why that part gets so much traffic.

Key architectural trade-offs

  • Server failure can lose up to a few seconds of ephemeral driver coordinates, but client retry will refresh coordinates on the next ping.

Starting architecture & how to practise

The simulator starts you with a baseline setup: Drivers & Riders → Location & Dispatch API → Rides DB. Run the baseline under 40,000 RPS to watch exactly which component saturates first, then add caching, queues, replicas, sharding or CDN until latency, availability and cost all turn green.

Common interview questions for Ride-Sharing Driver Matching

What are the target SLA and scale numbers for Ride-Sharing Driver Matching?

Design for 40,000 RPS sustained (spiking to 64,000 RPS) with a 50% read / 50% write mix, keeping p99 latency under 100 ms, availability at or above 99.99%, and infrastructure spend within $950/month.

What is the main architectural bottleneck in Ride-Sharing Driver Matching?

Drivers send a position every few seconds and riders ask 'who is near me'. Keep the latest positions in memory with a geo index; only trips need durable storage.

How can I verify my Ride-Sharing Driver Matching architecture works under load?

Open the live simulator to wire up load balancers, caches, queues, replicas, or shards and run a 60-second traffic simulation that grades latency, error rate, and monthly cost automatically.

Recommended lessons before you build

Related Geospatial & Mobility problems