The Scale & Latency Barrier
For Swiggy Instamart's marquee celebrity campaign featuring The Great Khali ('Khali Cart'), the engineering challenge was unprecedented: generate personalized comedic oversized grocery carts in real time for millions of simultaneous mobile shoppers.
The viral social push meant traffic spikes could jump 20x within 90 seconds. A single bottleneck in the personalization API would crash user sessions and ruin marketing ROI.
- Anticipated traffic surges exceeding 50,000 requests per second at campaign drop.
- Need for sub-50ms dynamic cart item calculations based on user historical ordering patterns.
- Zero toleration for database connection pool exhaustion under sudden flash spikes.
The High-Throughput Architecture
We built an event-driven edge personalization engine decoupled from core ordering databases. Pre-computed user affinity graphs were cached in high-availability distributed Redis clusters.
Dynamic cart generators rendered lightweight SVG canvas previews client-side, eliminating server rendering overhead while delivering fluid, shareable social mockups in under 100 milliseconds.
- Designed stateless microservices deployed across auto-scaling AWS ECS containers backed by Kafka message queues.
- Engineered client-side canvas synthesis enabling users to download customized Instagram and WhatsApp story cards instantly.
- Implemented circuit breakers and graceful degradation to guarantee core grocery checkout availability regardless of campaign load.
“Decoupling viral campaign compute from transactional databases allowed us to push 4.8 million users through custom carts without a single blip in order processing.”
— Engineering Lead, Infrastructure
Distributed Systems Blueprint
Traffic entered through Cloudflare Enterprise with edge caching of static assets and algorithmic rate limiting against malicious bot flooding.
Personalization queries were routed to an edge-localized Redis cluster holding tier-1 grocery catalog items. Response payloads were compressed to under 4KB per request.
- Multi-region container orchestration scaling from 4 to 80 container instances in under 120 seconds.
- Kafka consumer pools asynchronously logging user engagement telemetry for post-campaign analytics.
- Automated stress testing validating resilience up to 100,000 simulated requests per second prior to launch.
Campaign & Business Outcomes
The campaign became an instant viral hit across Indian social media, generating over 12 million custom cart creations with zero downtime and a p99 API response latency of under 45ms.
Instamart recorded a 31% uplift in grocery re-order conversions from participating customers, demonstrating how playful technical engineering drives direct commercial revenue.
- 4.8 million peak concurrent shoppers during prime dinner ordering hours.
- Zero outages or service degradation across Swiggy's primary food & grocery delivery lines.
- +31% boost in repeat weekly grocery baskets for participating campaign users.