How we prepare Shopify for BFCM
Shopify readies for Black Friday Cyber Monday with a year-long program that runs from March to October. It combines capacity planning on Google Cloud, What Could Go Wrong risk assessments, chaos-engineering Game Days on critical journeys like checkout, and a centralized Resiliency Matrix of failure modes, RTOs and runbooks. Five scale tests at forecast and p99 load (up to 200M requests per minute) used the Genghis load generator from three GCP regions, Toxiproxy fault injection and regional failovers. The tests surfaced issues such as checkout queue backups, rate-limit paths in authenticated checkout and slow region rebalancing. The newly rebuilt analytics platform needed more Kafka partitions, API memory optimization, connection-timeout tuning and load-balancer changes before facing its first holiday peak.
Related posts
- Performance Testing At Scale—for BFCM and Beyond
Shopify Engineering mediumAdeptShopify prepares for Black Friday Cyber Monday by repeatedly running full-scale load tests against production: scaling Shopify Core and dependencies (nginx routing, ProxySQL, key/value store) to their BFCM profile, layering five Cronograma-driven traffic flows (browse/buy, admin, flash sale, Storefront API, Hydrogen/Oxygen) with an abort switch, then scaling down in reverse order and running blameless retrospectives. Full-scale testing is chosen over scaled-model testing because databases and vertically scaled components don't extrapolate and many failures, such as TCP connection-count exhaustion, appear just from running a larger fleet. Practical workarounds include partially bypassing the CDN to avoid overloading a few PoPs, cache-busting requests to avoid skewed results, and single-region failover tests to verify capacity.
- How to Reliably Scale Your Data Platform for High Volumes
Shopify Engineering mediumAdeptShopify's Data Platform Engineering team prepared Tier 1 and Tier 2 ingestion and query services for a forecast near-doubling of BFCM 2020 traffic with a five-step reliability process. The steps were to define each service's primary objective (a freshness SLO for the Longboat batch ingester, a latency SLO for Reportify), identify tunable knobs such as job frequency, overlap interval, GKE CPU/memory, BigTable node pools and ProxySQL pools, and constrain those knobs to simulate N-times load. Teams then validated that every alert was actionable with simple runbooks and decided where to scale or tune. The exercise led to cluster scale-ups and job and query tuning, and BFCM ran with a 150% throughput increase and only minor self-healing incidents.
- Scaling Shopify's BFCM Live Map: An Apache Flink Redesign
Shopify Engineering mediumAdeptShopify scaled its Black Friday/Cyber Monday live sales map by putting Apache Flink in front of Cricket, its home-grown Go stateful streaming service. Flink filtered the checkout Kafka stream so Cricket processed only about one percent of the events, and Flink also computed new metrics such as product trends and unique shoppers. The Flink jobs used cross-region sharding and active-active deployment, handled load tests of 1M events/sec and ran with 100% uptime through BFCM, with Spark batch jobs as a fallback. Redis used for broadcasting to browsers still became a bottleneck and briefly clogged in production, so the planned redesign moves all metrics into Flink and snapshots them to a store that a web tier serves from an in-memory cache.
- Test Budget: Time Constrained CI Feedback
Shopify Engineering mediumAdeptShopify's Test Infrastructure team evaluated a "test budget" for its 170,000-test Rails monolith: tests chosen by call-graph test selection are reordered with prioritization heuristics so failures surface early, and execution stops at a fixed time limit. Six criteria (failure rate, average duration, churn, coverage, complexity, random) were compared using Time to First Failure, APFD and a Convergence Index. Historical failure rate performed best, finding 80% of failures after running 60% of the selected suite, while churn and complexity were nearly useless. The analysis suggests stopping at under 70% of the test-selection suite would still catch the first failure in most builds.
- Shopify's Playbook for Scaling Machine Learning
Shopify Engineering easyNoviceShopify's approach to scaling machine learning grew out of its first ML product, an order fraud detector that replaced a rule-based system with a high false-positive rate. Teams should pick a problem users care about, confirm the data is trustworthy and accessible, account for downstream dependencies such as fulfillment, and optimize for product outcomes rather than raw model scores. Shopify shipped a simple logistic regression model, built in Python, serialized to PMML, scheduled with Airflow and served in real time from Rails. To scale to hundreds of models, Shopify relies on input/output reconciliation, shadow backtesting, drift monitoring, platform-enforced best practices and automated model operations.