Uber System Design
Uber-scale ride hailing: real-time locations, matching and push
By Ankur NayakReviewed
How a ride-hailing platform matches riders with nearby drivers in seconds: drivers stream GPS into an in-memory geospatial index, dispatch searches nearby hexagonal cells, and a push platform delivers offers and trip updates over persistent connections.
Open in Studio· edit a copy- Users
- 215M monthly active consumers
- Trips per quarter
- 4.06B
- Trips per day
- ~44M
- Kafka volume
- Trillions of msgs/day
- Push connections
- 1.5M+ concurrent
Requirements
Functional
- Riders request a ride and see nearby drivers and an ETA
- Drivers stream their location and receive trip offers
- Match each request to a suitable nearby driver in seconds
- Live trip tracking, dynamic (surge) pricing, payment at the end
Non-functional
- Matching completes in a few seconds; location updates every few seconds
- Trip state is never lost and transitions exactly once
- Keep working through the loss of a server, zone or region
- Scale with cities and peak events (New Year's Eve)
In depth
A real-time marketplace
Uber is less a website than a live marketplace: millions of drivers moving every second, riders appearing anywhere, and a system that has to pair them in a few seconds. Three streams of data drive everything: where drivers are, who wants a ride, and what happens to each trip. Each gets the storage that fits it.
What it has to do
The scale is large and very real-time. In the third quarter of 2026 Uber completed 4.06 billion trips, roughly 44 million a day, for about 215 million monthly active consumers. Riders need to see nearby cars and an ETA, drivers stream their location and receive offers, and each request should be matched to a suitable driver within a few seconds. Underneath, the non-functional demands are strict: location updates arrive every few seconds, a trip's state must never be lost or transition twice, and the system has to keep working through the loss of a server, a zone or a whole region, including on peak nights such as New Year's Eve.
Where drivers are
Driver apps send their position every few seconds. That data is enormous, short-lived and constantly queried, so it lives in memory, not in a database. Uber's Ringpop library (2016) describes exactly this: its first use case was the geospatial service that keeps live driver locations in memory, sharded across a cluster with consistent hashing and SWIM-style gossip for membership. If a node dies, its share moves to neighbours and drivers' next pings refill it.
To make "who is near this pickup?" fast, locations are indexed by cell. Uber's open-source H3 grid uses hexagons at 16 resolutions; a lookup reads the pickup's cell and the rings around it instead of scanning a city. See geospatial indexing.
Matching
Uber hasn't published its current dispatch internals, so treat this part as a model rather than a description. The shape is consistent across public talks and interview practice: take the candidates from nearby cells, rank them by estimated time to pickup on real roads, offer the trip to the best driver with a short timeout, and move on to the next if they decline.
What happens to each trip
Trips are the opposite of locations: low volume, but they must never be lost or applied twice. Uber built Schemaless on sharded MySQL, then evolved it into Docstore, where each partition is replicated with Raft and is strictly serializable. Schemaless also had triggers, and Uber's write-up describes billing a trip when its final state is written.
Pushing to phones
Offers and trip updates are pushed through RAMEN, Uber's push platform, over persistent connections with at-least-once delivery. Its second generation reported more than 1.5 million concurrent connections and over 250,000 messages per second.
Events everywhere
Location and trip events flow through Kafka: trillions of messages a day as of 2020. Producers write to regional clusters, and uReplicator copies them into aggregate clusters in each region, so consumers such as surge pricing, which computes supply and demand per hexagon with Flink, can keep running if a region is lost.
When things fail
Each of Uber's data paths has its own failure story, and each recovery reflects the kind of data it carries.
- A supply index server dies. Ringpop's gossip-based membership notices the dead node, and its cells move to neighbours on the hash ring. They start empty, but drivers report their positions every few seconds, so the index heals itself almost immediately. Riders might briefly see fewer cars nearby, and matching retries.
- The push platform is degraded. Offers and trip updates can't be pushed. Apps reconnect to other servers and re-fetch the current trip state, and offers that time out are simply made to the next driver. RAMEN's at-least-once delivery with acknowledgements means messages aren't silently dropped, and clients can poll trip state as a fallback.
- A regional Kafka cluster fails. Because uReplicator copies events into aggregate clusters in each region, active-active consumers such as surge pricing keep computing from the other region's aggregate cluster. Riders notice little; some analytics lag.
The trade-offs
- An in-memory supply index instead of a database. Keeping live driver locations in memory, sharded by area, supports millions of updates and queries per second, and the state rebuilds itself because drivers keep reporting. The costs are losing a node's state when it fails (briefly) and needing cluster membership and routing, which is what Ringpop provides.
- Strong consistency for trips, eventual consistency for locations. Trips go to a strongly consistent store so none are lost or double-assigned, while high-volume telemetry and surge run on cheaper, eventually consistent streams. The price is operating two very different storage paths.
- Hexagons for geography. H3's hexagons have uniform distances to their neighbours and hierarchical resolutions from city-wide to street level, which makes aggregation such as surge per area natural. Hexagons don't nest exactly, so parent and child cells are approximate; geohash rectangles and Google's S2 cells are the common alternatives.
What to take away
- Match storage to the data: memory for locations, strong consistency for trips, streams for events
- Geospatial cells turn "nearby" into key lookups
- Persistent connections for anything the user is waiting on
- Design for regional failure at the event-stream level too
Components
Rider App
Client. Requests rides, shows nearby cars, ETA and live trip progress.
Driver App
Client. Sends GPS updates every few seconds and accepts or declines offers.
Edge Gateway
Go (Zanzibar)API gateway. Code-generated API gateway: protocol handling, authentication, rate limiting, then routing to backend services with retries and circuit breaking.
Building block: API Gateway, Rate Limiting Algorithms, Circuit Breaker
Location Service
inferredService. Ingests driver GPS pings, updates the supply index and publishes location events.
Supply Index
In-memory, RingpopCache. Live driver locations held in memory, sharded across servers with consistent hashing; looked up by geospatial cell.
Why: Locations change every few seconds and are queried constantly; an in-memory index sharded by area keeps both cheap.
Building block: Geospatial Indexing, Consistent Hashing
Dispatch
inferredService. For each ride request, finds candidate drivers near the pickup, ranks them and offers the trip.
Building block: Geospatial Indexing
Ride Request
inferredService. Pickup location, product type and rider constraints.
Cell Lookup
inferredService. Converts the pickup to an H3 cell and expands to neighbouring rings.
Building block: Geospatial Indexing
Nearby Drivers
inferredCache. Available drivers found in those cells from the supply index.
ETA Ranking
inferredService. Ranks candidates by estimated time to pickup along the road network.
Offer & Timeout
inferredService. Offers the trip to the best driver; on decline or timeout, moves to the next.
Maps & ETA
inferredService. Road-network routing and ETA prediction for pickup and trip.
Trip Service
inferredService. Owns the trip lifecycle: requested → accepted → arrived → on trip → completed.
Requested
Service. Rider asked for a ride; matching in progress.
Accepted
Service. A driver accepted; rider sees the car approaching.
On Trip
Service. Rider picked up; live location shared.
Completed
Service. Fare finalised; billing is triggered.
Trip Storage
Docstore / SchemalessSQL database. Uber's distributed database on sharded MySQL: Raft-replicated partitions with strict serializability per partition.
Why: Trip state must not be lost or applied twice; per-partition strong consistency gives that while still scaling out.
Building block: Database Sharding, Replication, CAP Theorem
Push Platform
RAMENRealtime gateway. Keeps persistent connections to rider and driver apps and delivers offers, trip updates and locations with at-least-once delivery.
Building block: WebSockets & Persistent Connections
Event Streams
KafkaStream. Regional Kafka clusters replicated into aggregate clusters for a global view; carries location, trip and marketplace events.
Building block: Message Queue & Event Log
Surge Pricing
FlinkWorker. Measures supply and demand per hexagon in real time and sets dynamic prices.
Building block: Geospatial Indexing
Billing & Payments
Service. Charges the rider when a trip completes, triggered by the trip's final state write.
Payment Processors
External API. Card networks and wallets.
Other Region's Kafka
Aggregate clusterStream. Aggregate clusters in each region receive all regions' events via uReplicator.
Request flows
Rider requests a ride
- The rider taps Request; the app sends the pickup point and product type.
- The edge gateway authenticates the rider and creates a trip in the 'requested' state.
- The new trip is written durably before anything else happens.
- Dispatch is asked to find a driver for this pickup.
- It looks up available drivers in the pickup's hexagonal cell and the rings around it.
- Candidates are ranked by estimated time to pickup on real roads.
- The best driver is offered the trip through the push platform.
- The offer arrives over the driver app's persistent connection; they have a few seconds to accept.
- The driver accepts; the trip moves to 'accepted'.
- The rider sees the driver's name, car and live position approaching.
A driver's location updates
- Every few seconds the driver app sends its GPS position.
- The location service receives it.
- The in-memory supply index moves the driver to their current cell.
- The update is also published as an event.
- Surge pricing aggregates supply and demand per hexagon from the stream.
Failure scenarios
What if: a supply index server dies?
The ring membership (gossip) notices the dead node and its cells move to neighbours on the hash ring. They start empty, but drivers re-report their positions within seconds, so the index heals itself.
User impact: A few seconds where some nearby cars don't appear; matching retries.
- Consistent hashing limits how many cells move
- Frequent location updates rebuild state quickly
What if: push platform is degraded?
Offers and trip updates can't be pushed. Apps reconnect to other servers and re-fetch current trip state; offers that time out are re-offered to the next driver.
User impact: Delayed offers and stale car positions until connections are restored.
- At-least-once delivery with acknowledgements
- Clients poll trip state as a fallback
What if: a regional Kafka cluster fails?
Events are replicated into aggregate clusters in each region, and active-active consumers such as surge pricing run in more than one region, so surge keeps computing from the other region's aggregate cluster.
User impact: Little or none for riders; some analytics lag.
- uReplicator into regional aggregate clusters
- Active-active and active-passive consumer strategies
Trade-offs
In-memory supply index vs. a database
Keep live driver locations in memory, sharded by area.
- Pros
- Millions of updates and queries per second
- Self-healing: drivers re-report constantly
- Cons
- State lost on node failure (but rebuilt in seconds)
- Needs cluster membership and routing (Ringpop)
Strong consistency for trips, eventual for locations
Trips in a strongly consistent store; locations and surge on eventually consistent streams.
- Pros
- No double-assigned or lost trips
- High-volume telemetry stays cheap
- Cons
- Two very different storage paths to operate
Hexagonal grid (H3)
Index and aggregate by H3 hexagons.
- Pros
- Uniform neighbour distances
- Hierarchical resolutions for city-wide to street-level views
- Cons
- Hexagons don't nest exactly; parent/child relationships are approximate
Alternatives: Geohash rectangles; Google S2 cells
Frequently asked questions
How does Uber find nearby drivers so quickly?
Driver locations are kept in memory and indexed by geospatial cell. A request's pickup point is converted to a cell, and the system only looks at drivers in that cell and the surrounding ones, then ranks those candidates by estimated time to pickup.
What is H3?
H3 is Uber's open-source hexagonal grid. It maps any latitude/longitude to a 64-bit cell ID at one of 16 resolutions, with each finer level having cells about one seventh the area. Uber uses it to measure supply and demand per hexagon, for example for surge pricing.
How does the driver app receive trip offers instantly?
Through Uber's push platform (RAMEN), which keeps a persistent connection open to each active app and delivers messages with at-least-once guarantees. Its second generation reported more than 1.5 million concurrent connections and 250,000 messages per second.
What database does Uber use for trips?
Uber built Schemaless, an append-only datastore on sharded MySQL, and later evolved it into Docstore, a distributed SQL database whose partitions are replicated with Raft and offer strict serializability within a partition.
Building blocks used
Sources
- Uber Announces Results for Third Quarter 2026 · Uber Investor Relations
- The Architecture of Uber's API gateway · Uber Engineering
- Uber's Real-Time Push Platform · Uber Engineering
- H3: Uber's Hexagonal Hierarchical Spatial Index · Uber Engineering
- How Ringpop from Uber Engineering Helps Distribute Your Application · Uber Engineering
- Designing Schemaless, Uber Engineering's Scalable Datastore Using MySQL · Uber Engineering
- Evolving Schemaless into a Distributed SQL Database · Uber Engineering
- Disaster Recovery for Multi-Region Kafka at Uber · Uber Engineering
- H3 documentation · H3 project