Design Swiggy's Real-Time Order Tracking System
Problem
Design the backend for Swiggy's live order tracking — where customers see the delivery agent's location update in real time on a map.
Requirements
Functional:
- Customer sees agent location update every 5 seconds
- ETA recalculation on each location update
- Agent app sends GPS coordinates
- Push notification on key milestones (order picked up, nearby)
Non-functional:
- 2M concurrent active orders at peak
- Location update latency < 3s end-to-end
- 99.9% uptime
Discussion points
- Agent → server: HTTP polling vs WebSocket vs MQTT
- Server → customer: Server-Sent Events vs WebSocket
- Location storage: time-series DB vs Redis sorted set
- ETA model: static map + ML delta correction
- Geo-fence triggers for push notifications
added …