Preventing App Performance Degradation Due to Sudden Ride Demand Spikes
Article Summary
Grab's engineering team faced a brutal problem: rain in Southeast Asia would crash their entire ride-hailing system. When demand spiked locally, users everywhere suffered.
Grab's engineers built the 'Spampede' filter, a circuit breaker inspired solution that prevents localized demand spikes from degrading app performance globally. The system intelligently throttles requests when supply can't meet demand in specific geographic areas.
Key Takeaways
- Uses Geohash algorithm to bucket locations without expensive API calls
- Redis INCR tracks unallocated requests with automatic TTL cleanup
- Intentionally drops bookings to protect system-wide availability
- Trades monitoring accuracy for throughput using time bucketing
- Processes requests before hitting downstream services to minimize load
By strategically rejecting requests in oversaturated areas, Grab prevented localized demand spikes from taking down their entire platform.
About This Article
Grab's early system couldn't scale when demand spiked. Engineers had to work late nights to manage traffic during peak times, like rainstorms during morning rush hour.
The Spampede filter uses the Geohash Integer algorithm to convert pickup locations into geographic buckets. Unix timestamp formulas create time buckets. Unallocated requests are tracked in Redis with automatic TTL expiration.
By rejecting bookings in oversaturated areas before calling downstream services, Grab stopped localized demand spikes from breaking the entire system and affecting users everywhere.