System Design Problem

Design a Real-time Vehicle Tracking System

Commonly Asked By:UberLyftGrabDoorDash

  • Live tracking: Display real-time location of vehicles on a map (fleet management, delivery tracking)
  • Location ingestion: Ingest GPS coordinates from thousands/millions of vehicles at configurable intervals
  • Trip tracking: Track active trips with start, waypoints, and end; record full route trail
  • Geofence alerts: Trigger alerts when vehicles enter/exit defined zones
  • Historical playback: Replay a vehicle's route over any past time period
  • Speed/idle alerts: Detect speeding, excessive idling, harsh braking events
  • Fleet dashboard: Real-time overview of entire fleet: active, idle, offline vehicles
  • ETA for deliveries: Show customer the live position and ETA of their delivery
  • Multi-tenant: Support multiple fleet operators on the same platform

Vehicles stream GPS data via MQTT to a broker cluster, which bridges to Kafka. Flink processes the stream, updating Redis (latest position) and TimescaleDB (trail). Dashboards receive real-time updates via WebSocket subscribed to Redis Pub/Sub.

Loading...