Optimising the Swiggy Restaurant App
Article Summary
Swiggy's restaurant app was crashing under load. Their React Native app couldn't handle more than 100 orders on budget devices, and they needed to scale 10x.
The Swiggy engineering team shares their journey optimizing their restaurant partner app from single-outlet to multi-outlet support. What started as obvious fixes led to discovering a critical throttling issue that was destroying performance.
Key Takeaways
- 20% FPS improvement and 27% better Flashlight performance score during peak hours
- Cut API calls by 50% through FCM event throttling logic
- App now handles 600+ orders on 2GB RAM devices (previously crashed at 100)
- ImageKit resizing reduced delivery agent photos from 4.37MB to 5KB each
- Dead code removal and async storage cleanup had zero performance impact
Throttling Firebase Cloud Messaging events was the breakthrough that cut API calls in half and enabled the app to scale from single to multi-outlet support without crashes.
About This Article
During peak hours, Swiggy's restaurant app made 150 consecutive Fetch Orders API calls. This happened because 30 active orders changed state across 5 stages. The system got overwhelmed with redundant network requests.
Shubham Singla's team added FCM event throttling logic. It groups multiple Firebase Cloud Messaging events and consolidates them into fewer API calls. The throttling uses a 10-second interval threshold.
API calls dropped by 50%, which improved network performance. The app can now handle 600+ orders across all device segments. Previously it would crash when handling 100-600 orders depending on RAM capacity.