Overview
The client’s live-tracking map was either too chatty—hitting geocoding limits—or too sparse—dots lagging minutes behind. We needed sub-second updates without breaking the bank.
Challenges
- Balancing real-time update frequency against strict API quotas
- Avoiding overage fees while keeping UX snappy
- Ensuring address inputs validated before geocoding
Solutions
- Switched to WebSockets to stream only changed lat/lon pairs—no full refreshes
- Built an Elasticsearch-backed geospatial validator to pre-check user inputs
- Implemented token-bucket throttling to respect Mapbox quotas
- Cached recent geocoding results in Redis, cutting repeat calls by 60%
Screenshots



Final Notes
Tackling real-time constraints taught me the nuance of efficient API usage and stateful streaming.
- Location accuracy ↑ 99% (user complaints ↓ 80%)
- API usage ↓ 60%, avoiding overage fees
- Real-time updates at 10 Hz with imperceptible lag
- Geocoding errors ↓ 40%