Shopify’s 2022 Engineering Roadmap: Modular Architecture, Cloud Dev, and Load Testing

Shopify’s Black Friday Cyber Monday (BFCM) in 2021 was its biggest ever, and the numbers from that four-day period are a preview of the scale challenges ahead. Peak traffic surpassed 32 million app server requests per minute (RPM), while load balancers peaked at more than 34 million RPM. One flash sale generated enough load to consume over 20% of total computing capacity at its peak.

Those traffic spikes came with a hefty operational workload. During BFCM 2021, Shopify’s infrastructure handled 42 billion API calls, delivered 13 billion webhooks, and sent nearly 145 million emails. The storefront caching layer wrote 3.18 PB and read 15 PB of data, while the MySQL fleet sustained over 11 million queries per second and 11 TB per second of read I/O. Egress network traffic averaged 30 TB per minute.

Looking ahead, CTO Allan Leinwand says the company’s engineering focus for 2022 is on three areas: modular code, cloud-based development environments, and making load testing a routine part of the development workflow.

Breaking Up the Monolith

Shopify has been evolving its famous Rails monolith into a “majestic modular monolith” for several years. In 2022, the team plans to continue decomposing parts of it to improve developer productivity and merchant performance.

A concrete example is the storefront rendering process, which was split out of the modular monolith repo. After the split and some refactoring, cache fill rates were four times faster and page render times five times faster. Extracting the renderer also means it can be deployed in geographies around the planet without having to deploy the full Rails monolith, reducing round-trips between store and browser. Engineers working on repos that directly impact merchant performance can iterate and deploy more quickly, and the setup offers tighter coupling with debugging and resiliency tools.

Cloud Development Environments

Shopify is moving the majority of its developers into Spin, its cloud development environment. With Spin, developers can spin up a full development environment in seconds rather than minutes, and can run multiple environments for experimentation and sharing work-in-progress. The company has also moved all engineering onto Apple M1 MacBook Pro laptops, which combined with Spin have already boosted developer productivity.

This shift opens the door for improved IDE and browser extensions, and for solving developer problems at a scale that wasn’t possible with local development environments.

Load Testing as a Development Practice

Shopify’s BFCM 2021 preparation included load testing starting in July, culminating in the highest load test in company history: a load balancer peak of 50.7 million RPM. But flash sales that spike in minutes are less predictable than seasonal growth patterns like BFCM. To handle larger and spikier scale, Shopify is continuing to improve its in-house load testing tools.

These tests help teams understand how products handle platform-wide surge scenarios, whether sales are exclusively online, in-person via retail POS, or a combination. Automating and integrating load tests into the product development process is critical to avoiding performance issues as the platform scales alongside merchants.

The practice of load testing at Shopify has come a long way from where we started at Shopify, but there's always more we can do. In this video Bart shares a look at how this work started and a look at where we hope to take this work in the future. 🔮

What Isn't Changing

Shopify remains committed to Rails and is doubling down on React Native for mobile. The company also contributed YJIT, a new just-in-time (JIT) compiler that merged with Ruby 3.1. YJIT is 31% faster than interpreted CRuby and 26% faster than MJIT, reaching near-peak performance after a single benchmark iteration, with significant impact on production code execution times within and outside Shopify.

Infographic of Shopify's BFCM 2021 technical stats
Shopify's technical stats from BFCM 2021

Leinwand emphasizes that the goal is to make it easy for developers to do their best work—removing friction around environment setup and code builds so engineers can focus on shipping impactful changes at scale.