Skip to main content
BLUEPRINT #03Production Case Studies

Design Uber's Real-Time Dispatch & Schemaless MySQL Storage

Target AWS Architecture:Kinesis
Referenced Architecture Primitives (3)
Click any primitive to study its algorithmic deep dive
10-Stage Structure:1. Requirements→2. Sizing→3. Topology→4. Data Model→5. AWS Topology→6. Deep-Dive→7. Failures→8. SRE Playbooks

1. Problem Statement & Scope Clarification

System Mission

Design Uber's real-time geospatial dispatch engine and distributed trip data persistence layer. The platform must process millions of continuous driver GPS telemetry pings per second, compute sub-millisecond supply-demand matching using hexagonal geospatial partitioning (Uber H3), coordinate the end-to-end trip lifecycle state machine, and store immutable trip records across a custom sharded append-only storage engine on MySQL (Schemaless).

Functional Requirements

  1. High-Frequency Telemetry Ingestion (DriverLocationPing): Ingest GPS coordinates from 6M+ drivers every 4 seconds4\text{ seconds} with P99<10 msP99 < 10\text{ ms}.
  2. Geospatial Supply/Demand Matching (DispatchRider): Given a rider's pickup latitude/longitude, locate and rank the top K=10K=10 nearest available drivers in <20 ms< 20\text{ ms} using H3 hexagonal spatial indexing.
  3. Trip Lifecycle State Machine: Coordinate state transitions (REQUESTED →\rightarrow MATCHED →\rightarrow ARRIVED →\rightarrow IN_PROGRESS →\rightarrow COMPLETED) with strict idempotency and zero lost transitions.
  4. Append-Only Immutable Trip Storage (Schemaless): Persist structured JSON trip payloads without schema migrations, supporting cross-shard secondary indexing.

Non-Functional Requirements (SLAs & SLOs)

  • High Availability: 99.999%99.999\% uptime for dispatching and location tracking.
  • Low Match Latency: P50<10 msP50 < 10\text{ ms}, P99<35 msP99 < 35\text{ ms} for dispatch ring execution.
  • Zero Loss of Financial Trip Data: Absolute durability across Multi-AZ storage cells.

2. Capacity & Scale Estimation (Back-of-the-Envelope Math)

Telemetry Scale

  • Active Drivers Worldwide: 6,000,0006,000,000.
  • Location Ping Frequency: Every 4 seconds4\text{ seconds}.
  • Peak Telemetry Ingestion Throughput: Peak Ingest QPS=6,000,000 drivers4 s=1,500,000 QPS\text{Peak Ingest QPS} = \frac{6,000,000\text{ drivers}}{4\text{ s}} = \mathbf{1,500,000\text{ QPS}}
  • Location Payload Size: ≈128 bytes\approx 128\text{ bytes} (driver_id, lat, lng, bearing, speed, h3_index, timestamp).
  • Telemetry Ingestion Bandwidth: Ingest Bandwidth=1,500,000×128 bytes=192,000,000 B/s≈1.536 Gbps\text{Ingest Bandwidth} = 1,500,000 \times 128\text{ bytes} = 192,000,000\text{ B/s} \approx \mathbf{1.536\text{ Gbps}}

Trip Persistence Scale

  • Daily Completed Trips: 30,000,000 trips/day30,000,000\text{ trips/day}.
  • Average Trip Record Size (Schemaless Payload): 8 KB8\text{ KB} (includes route coordinates, pricing breakdowns, audit timestamps).
  • Daily Storage Growth: Daily Storage=30,000,000×8 KB=240 GB/day\text{Daily Storage} = 30,000,000 \times 8\text{ KB} = \mathbf{240\text{ GB/day}}
  • 5-Year Retention Storage (with 3x replication): 5-Year Storage=240 GB×365×5×3≈1.314 PB NVMe SSD\text{5-Year Storage} = 240\text{ GB} \times 365 \times 5 \times 3 \approx \mathbf{1.314\text{ PB NVMe SSD}}

3. High-Level Architecture & Component Mapping

Interactive Architecture Diagram
Synthesizing vector architecture diagram...

Part 2: Production Deep-Dive Locked1 Coin = 24 Hours

Unlock Complete Architecture & Production Runbooks

Your Balance:40 Coins

You have explored the free architectural preview (~50%). Spend 1 Coin to unlock the remaining 6 production deep-dive sections for a full 24 hours.

Sections Included in This 24-Hour Pass:
4. API Interface Design & Wire Protocol
5. Data Model & Database Schema (Schemaless Model)
6. Deep-Dive: Uber H3 Hexagonal Spatial Indexing
7. Reliability, Ringpop Cluster & Schemaless Replication
8. Comprehensive Trade-off Matrix
9. Real-World Engineering Failure Modes & Post-Mortem Lessons
Keeps page unlocked for exactly 24 hoursSpend coins to fund LLM & compute infrastructure