System Design: Real-Time Delivery Logistics and Route Visualization Platform
Context
Design a platform that allows dispatchers and end customers to view couriers' real-time positions and routes for millions of deliveries per day. The system must ingest GPS data from courier apps, compute and render routes, stream live updates to web/mobile clients, and support historical route queries.
Requirements
-
Functional
-
Real-time tracking of couriers on a map (sub-second to a few seconds latency).
-
Route computation with ETAs; dynamic re-routing with traffic.
-
Live and historical route visualization for dispatchers and customers.
-
Order lifecycle: create order, assign courier, update status, complete.
-
APIs for orders, assignments, location updates, live/historical route queries.
-
Non-functional
-
Scale to millions of deliveries/day; hundreds of thousands of concurrent couriers.
-
Low-latency updates; high availability; multi-AZ deployment.
-
Event-driven architecture with durable streams.
-
Offline handling for mobile; privacy controls; failure recovery.
-
Monitoring, alerting, and capacity estimates (compute, storage, bandwidth).
Deliverables
Detail: service architecture, data model, GPS ingestion pipeline, route computation, map rendering, event streaming, scalability plan, latency vs. consistency trade-offs, offline handling, privacy controls, failure recovery, APIs (orders, assignments, locations, queries), capacity/storage estimates, and monitoring/alerting.