The situation
Allbirds has built one of the most recognized sustainable footwear brands in the world. Their e-commerce backend had to match that reputation — fast, reliable, consistent regardless of traffic volume or environment. The problem we were brought in to fix was checkout latency inconsistency. Under normal load, the checkout was fine. Under traffic spikes — a product drop, a media feature — it became unpredictable. P95 checkout response times would spike to 4–6 seconds. Customers abandoned. Revenue was left on the table. We pulled query execution plans on the checkout path and found the culprit: multi-table joins across product, inventory, variant, and pricing tables without appropriate composite indexes. Under concurrent load, these joins became full table scans. The fix sounds simple in hindsight — composite indexes on the high-selectivity columns, eager loading to eliminate N+1 queries — but identifying exactly which queries were the bottleneck took a methodical audit. While we were at it, we Dockerized the entire backend stack. Environment inconsistency — the kind that produces bugs that only appear in production — was eliminated. Every deployment since has been predictable.
What had to change
Checkout response times spiked to 4–6 seconds under traffic loads that should have been entirely manageable. Heatmaps and session recordings showed clear abandonment at the payment step during high-traffic windows. The engineering team also battled constant staging-vs-production inconsistencies that made reproducing and fixing bugs a slow process.
What we changed
SQL audit of the entire checkout query path: identified 6 queries responsible for 80% of the latency. Added composite indexes on high-selectivity columns, rewrote 3 queries with proper eager loading to eliminate N+1 patterns, moved email sending into a background job queue. Dockerized the full stack — consistent environments from laptop to production. Checkout response times stabilized under 1.2 seconds even at peak.
What the client gained
- 01 Checkout consistently under 1.2s even at peak
- 02 Composite indexes + eager loading on all hot paths
- 03 Docker stack — no more staging vs production surprises
- 04 Background jobs handle all email and async operations