Ride Booking (Uber / Ola)
System Design: Ride Booking (Uber / Ola) 🧠 Mental Model Uber is two concurrent real-time systems: location tracking and driver matching. Every second, millions of drivers push their GPS coordinate...

Source: DEV Community
System Design: Ride Booking (Uber / Ola) 🧠 Mental Model Uber is two concurrent real-time systems: location tracking and driver matching. Every second, millions of drivers push their GPS coordinates. When a rider requests a trip, the system finds the closest available driver, atomically assigns them, and keeps both maps in sync — all under 300ms. The hardest problems are concurrency (preventing double-booking) and geospatial search at scale. ┌──────────────────────────────────────────────────────────────┐ │ FAST PATH │ ┌──────────┐ │ ┌───────────────┐ GEORADIUS ┌──────────────┐ │ │ Driver │──►│ │ Location Svc │ ───────────► │ Match Engine │ ──► Driver │ │ App │ │ │ (Redis Geo) │ │ (top K score)│ notified │ └──────────┘ │ └───────────────┘ └──────┬───────┘ │ every 3-5s │ │ SETNX (atomic lock) │ └────────────────────────────────────────┼─────────────────────┘ │ ┌─────────────────────────────────────────▼────────────────────┐ │ RELIABLE PATH │ │ Trip event ──► Kafka ──► Trip DB (Postgres)