ShopifyJason Hiltz-LaforgeProblem & solution
Engineering a Historic Moment: Shopify Gets Ready for Cannabis in Canada
Summary
Canada’s 2018 cannabis legalization required Shopify to support a new, tightly regulated retail industry while keeping personal information in Canada. Using Google Cloud Platform’s Montreal region, the team created a Canadian Shopify instance with Terraform-managed projects, regional clusters, segregated workloads, PCI-compliant payment infrastructure, and a regional data warehouse. Because consumer behavior and peak demand were uncertain, engineers modeled traffic scenarios, ran repeated load tests across storefront actions, tested bot attacks, held pre-mortems, and provisioned five times projected launch traffic and sales. Multiple safeguards—including application-level endpoint checks, firewalls, limited secrets, unique SSL certificates, monitoring, and alerting—were layered to prevent data from crossing jurisdictions. Merchants opened across time zones, and the first legal sale occurred on Shopify’s point of sale in Newfoundland at 12:01 NST, followed by launches with zero downtime, excellent performance, and secure Canadian data storage and transmission.
Context
Canada’s cannabis legalization created a new regulated retail market on October 17, 2018. Shopify had to support licensed sellers while meeting the requirement that personal information remain stored in Canada, despite existing storage and communications systems located outside the country.
Approach / What changed
Shopify built a separate Canadian instance in Google Cloud Platform’s Montreal region, using Terraform to configure projects, networks, and Kubernetes Engine clusters. The team used regional clusters, workload segregation, repeated load tests, bot-attack modeling, pre-mortems, game days, and capacity for five times projected launch traffic. Data residency protections combined application endpoint checks, firewall rules, minimal secrets, unique SSL certificates, monitoring, and alerting.
Takeaways
Shopify created a Canadian regional deployment in Google Cloud Platform’s Montreal region, including PCI-compliant payment infrastructure and a regional data warehouse.
Capacity planning used uncertain consumer behavior as an input, with multiple traffic models, repeated load tests, bot-attack testing, and infrastructure sized for five times projected launch traffic and sales.
Canadian data residency was enforced in layers across the application, hosts, and network infrastructure through endpoint validation, firewalls, restricted credentials, unique SSL certificates, monitoring, and alerting.
FAQ
How did Shopify prepare for uncertain cannabis launch traffic?
The team modeled several scenarios, including worldwide interest, media-driven timezone spikes, rapid store-opening demand, and denial-of-service attacks. It ran repeated load tests with varied storefront actions, tested bot attacks, and scaled the environment to five times projected launch traffic and sales.
How was personal information kept inside Canada?
Shopify used a Montreal-region deployment and layered protections at the application, host, and network levels. These included safe-endpoint checks, strict firewall rules, minimal secrets, unique SSL certificates, monitoring, and alerting.
What happened when Canadian cannabis stores launched?
Merchants opened at one minute after midnight in their local time zones, creating launches across several hours. The first legal sale occurred on Shopify’s point of sale in Newfoundland at 12:01 NST, and the launches completed with zero downtime, excellent performance, and secure Canadian data storage and transmission.
Source and freshness
- Source
- shopify.engineering
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.