---
title: "Shopify"
description: "Global commerce platform powering millions of businesses with essential infrastructure and innovative engineering solutions."
---

# Shopify
> Global commerce platform powering millions of businesses with essential infrastructure and innovative engineering solutions.

## Articles

### [Writing Better, Type-safe Code with Sorbet](https://yomu.fyi/post/writing-better-type-safe-code-with-sorbet.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Jun 24, 2020

Ruby repositories can hide unsafe method calls and ambiguous data shapes when types are inferred from variable names alone. Sorbet static type checking addresses these risks with method signatures, typed structs, enums, and interfaces. It can flag a potentially nil return before a chained call, distinguish database output fields from input fields, and enforce contracts for synchronous and asynchronous indexers in a dependency-injected hexagonal structure. The article also describes Sorbet’s gradual typing, including five strictness levels and namespace-by-namespace adoption using the minimum typed level of true. The stated conclusion is that enforced type safety catches errors unit tests may miss and helps prevent unsafe code from reaching production.


### [Shopify's Data Science & Engineering Foundations](https://yomu.fyi/post/shopify-s-data-science-engineering-foundations.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Jun 18, 2020

Shopify’s Data Science & Engineering team describes the foundations it uses to provide daily insights to internal teams, merchants, and partners across a rapidly changing commerce ecosystem. Its data warehouse follows a shared dimensional-modelling philosophy, with modelled data built on Spark in a single GitHub repository and made broadly queryable through Presto, while ETL jobs are unit tested and prevented from failing silently. Centralized dashboards, reproducible vetted data points, peer review, product-aligned sub-teams, accessible communication, and cross-team collaboration extend those foundations into analysis and decision-making. Together, these practices let team members reuse existing work, produce trusted and understandable metrics, address the specialist gap through collaboration, and derive new metrics with fewer than 50 lines of SQL.


### [Spark Joy by Running Fewer Tests](https://yomu.fyi/post/spark-joy-by-running-fewer-tests.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Jun 11, 2020

Shopify’s monolithic Ruby repository has more than 150,000 tests, grows 20–30% annually, and takes 30–40 minutes to run across hundreds of Docker containers, making required full-suite CI costly and vulnerable to intermittent failures. The team built a dynamic-analysis test-selection system that logs method calls during each test, records files in each call graph, and maps changed files to relevant tests. Because Ruby, Rails metaprogramming, and non-Ruby files complicate tracing, the system adds Rails patches and fallback rules, runs extra tests when mappings lag, and executes the full suite asynchronously on every deploy. After two months and 8,360 merged commits, it achieved 99.94% failure recall, selected about 60% of tests, and reduced compute time by roughly 25%. Developers requested full-suite runs on fewer than 2% of pull requests.


### [Understanding Programs Using Graphs](https://yomu.fyi/post/understanding-programs-using-graphs.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Jun 2, 2020

TruffleRuby uses a sea-of-nodes graph as an intermediate representation after parsing, allowing its just-in-time compiler to optimize Ruby programs and translate them to machine code. The explanation contrasts this graph with an abstract syntax tree, then shows how control flow, data flow, side effects, pure computations, loops, and phi nodes are represented through boxes and arrows. A three-way conditional demonstrates global value numbering: a repeated multiplication becomes one movable computation that can float across branches without changing program behavior. A loop example shows backward control flow and repeated functional computation, while the discussion weighs graph-based optimization against poor compactness and readability at larger scales. Shopify is building graph-drawing and Ruby decompilation tools to inspect optimization at codebase scale.


### [ShipIt! Presents: How Shopify Uses Nix](https://yomu.fyi/post/shipit-presents-how-shopify-uses-nix.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: May 29, 2020

At a May 25, 2020 ShipIt! event, Shopify presented how it uses Nix to rebuild developer tooling and demonstrate the tools used day to day. The follow-up answers questions about runix and lorri interoperability, CI/CD, Ketos, remote-work download costs, dependency management, and pinned nixpkgs revisions. Shopify says its tooling is optimized for build workflows rather than development, so it spent substantial effort adapting bundleEnv/bundleApp to its preferred workflow and hopes to upstream the solution. Nix is not yet used for CI/CD; gems prompted the initial Nix work, while Node modules are not yet managed with Nix, and a project-specific nixpkgs revision is enforced whenever dev up runs.


### [7 Ways to Make Your SQL Workshop Beginner-friendly](https://yomu.fyi/post/7-ways-to-make-your-sql-workshop-beginner-friendly.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: May 21, 2020

Shopify’s 90-minute SQL workshop serves new RnD hires with varied technical backgrounds, including participants who may have no experience with databases or programming. It separates beginners from intermediate learners and aims to help beginners use data responsibly to discover insights. The beginner format spends its first 30 minutes on data warehouse architecture, data preparation, and privacy, then uses real production data and tools such as Mode Analytics with an accessible dataset. The curriculum identifies core SQL objectives, translates them into practical questions, starts with SELECT \* exploration, and builds queries toward a larger analytical question. It also provides beginner, intermediate, and advanced learning resources covering topics from foundational clauses and aggregations to joins, window functions, CTEs, and Presto-specific techniques.


### [What Is Nix](https://yomu.fyi/post/what-is-nix.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: May 19, 2020

Nix is presented as a way to make software’s usually implicit dependency graph explicit, motivated by the difficulty of quickly conveying its concepts and by Shopify’s ongoing use of it to rebuild developer tooling. Its core model has four building blocks: the immutable Nix Store, derivations, sandboxing, and the Nix language. The Store acts as a graph database whose nodes are immutable files or directories, while path hashes and embedded references represent dependencies and support transitive-closure queries. Derivations record build instructions and explicitly named inputs; the Nix language evaluates these descriptions and has essentially one side effect, creating derivation files, leaving other tools to build outputs. Nixpkgs is described as a lazily evaluated Nix program containing many derivations, and the article concludes with introductory resources and a discussion of Shopify’s use of Nix.


### [A Brief History of TLS Certificates at Shopify](https://yomu.fyi/post/a-brief-history-of-tls-certificates-at-shopify.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: May 14, 2020

Shopify’s TLS certificate infrastructure evolved from a handful of manually renewed certificates for administration and checkout traffic to an automated system supporting more than 1M merchants. The initial Shopify Plus implementation added domains to shared Subject Alternative Name (SAN) certificates, but manual provisioning, certificate-authority limits, extra IP requirements, and the inability to rely on SNI made the approach labor-intensive and error-prone. Notary automated certificate-authority API requests, domain verification, delivery, and renewals, storing one certificate and unique private key per domain in a relational database. OpenResty Lua middleware dynamically loaded certificates through ssl\_certificate\_by\_lua, while an in-memory LRU cache reduced handshake latency; theme processing replaced HTTP asset references to prevent mixed-content warnings. After reaching all-merchant encrypted storefronts in February 2016, Shopify migrated much of its certificate use to Let’s Encrypt and later a cloud edge, ultimately returning to Notary-issued certificates uploaded to both edge networks to simplify synchronization.


### [Dev Degree: Behind the Scenes](https://yomu.fyi/post/dev-degree-behind-the-scenes.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: May 13, 2020

Dev Degree is Shopify’s work-integrated learning program, designed to combine an accredited computer science degree with four years of continuous developer experience. Students take three university courses per semester while working 25 hours weekly, beginning with Shopify-led skills training before moving through four team placements across disciplines such as back-end, front-end, data, security, and production engineering. The program teaches tools and technologies including Git and GitHub, Ruby, Rails, React, TypeScript, and GraphQL, while emphasizing mentorship, feedback, personal development, and support from a multidisciplinary team working with university partners. The first cohort graduated on April 24, 2020, after adapting to program changes and remote learning during the pandemic; the post reports that 100% of graduates accepted full-time positions within six months.


### [How to Fix Slow Code in Ruby](https://yomu.fyi/post/how-to-fix-slow-code-in-ruby.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: May 8, 2020

Performance regressions can accumulate in a large monolithic Rails application, making it difficult to identify offending changes among thousands of daily commits. The post presents profiling and benchmarking as complementary practices: profiling locates runtime bottlenecks, while benchmarking compares code paths and validates fixes. It covers elapsed time, CPU versus wall time, object allocations, TracePoint and ObjectSpace, plus rbspy, stackprof, rack-mini-profiler, and App Profiler, which supports on-demand remote production profiling at Shopify. A flamegraph example showed garbage collection consuming about 35% of CPU time in a slow request, and the team inferred excessive Ruby object allocation; a Rails benchmark showed roughly 50x improvement from caching an order’s total price calculation. The discussion cautions against micro-optimizations whose gains do not justify code changes and recommends addressing larger performance issues first.


### [Categorizing Products at Scale](https://yomu.fyi/post/categorizing-products-at-scale.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Apr 30, 2020

Shopify describes a product-categorization system for more than one billion products across the Google Product Taxonomy, which contains over 5,000 hierarchical categories. The model uses product titles, descriptions, collections, tags, vendors, and merchant-provided types, with text preprocessing and a fixed-length term-frequency HashingTF featurizer in PySpark rather than image features or vocabulary-based methods such as Word2Vec. Kesler’s Construction transforms multiclass training into a binary dataset by embedding each candidate class into feature tokens, while logistic regression provides a single, interpretable classifier that can use taxonomy relationships and reduce computational load. The resulting baseline supports more than 20 teams and downstream experiences, while schematized Kafka events and an internal annotation platform provide human feedback; the post identifies class imbalance, multilingual text, and image features as improvement areas.


### [Software Release Culture at Shopify](https://yomu.fyi/post/software-release-culture-at-shopify.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Apr 15, 2020

Shopify describes its release culture as a combination of beliefs and behaviors shaping how developers ship software, with trust, velocity, and safeguards as stated goals. The team measures developer experience through biannual happiness surveys, shipping Slack channels, dogfooding, internal support, and UX research that includes shadowing developers and testing prototypes with interns and new hires. Its release pipeline runs from a pull request and /shipit command through the merge queue, Master, a Canary environment receiving 5% of incoming requests, and Production after a 10-minute testing period without intervention or automated alerts. Developers own releases without managers, sign-offs, or release windows, while /shipit --emergency provides a single fast recovery path. Shopify also uses Beta Flags for gradual rollouts and measures /shipit success through survey feedback and average pull-request time-to-production.


### [Building Arrive's Confetti in React Native with Reanimated](https://yomu.fyi/post/building-arrive-s-confetti-in-react-native-with-reanimated.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Apr 7, 2020

Shopify rewrote its Arrive package-tracking app in React Native and launched it on Android, where the earlier iOS-only app’s delivery confetti needed a cross-platform implementation. Rather than duplicate the iOS CAEmitterLayer code in Java or Kotlin, the team implemented the effect in JavaScript with Reanimated, whose declarative instructions run animation computations on the native UI thread after setup. The walkthrough initializes 100 randomized confetti, animates position and three-dimensional rotation from randomized velocities, and uses delta time, a clock, staggered delays, and edge-bounce elasticity to shape their motion. It also adds two confetti cannons and 2-dimensional confetti, while leaving cleanup of images and animation stopping beyond the post’s scope. The resulting version is described as resembling the original while spreading confetti more uniformly and making it behave more like paper.


### [Optimizing Ruby Lazy Initialization in TruffleRuby with Deoptimization](https://yomu.fyi/post/optimizing-ruby-lazy-initialization-in-truffleruby-with-deoptimization.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Mar 31, 2020

The post examines how TruffleRuby can optimize Ruby’s ||= operator when it is used for lazy initialization rather than repeated assignment. Static profiling of 20 popular open-source projects found 2,082 uses, with 64% meeting conservative criteria based on constant values or naming patterns for parameterless methods assigning instance or class variables. The implementation replaces the usual OrNode with an OrLazyValueDefinedNode, which counts executions of the right-hand side and deoptimizes when it is executed fewer than twice, allowing uncommon assignment paths to remain in the interpreter. In a benchmark, the change compiled code about 6% faster and produced about 63% less machine code by memory, although the post notes that benchmarking larger projects is noisy and the runtime impact is difficult to prove.


### [Refactoring Legacy Code with the Strangler Fig Pattern](https://yomu.fyi/post/refactoring-legacy-code-with-the-strangler-fig-pattern.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Mar 11, 2020

Shopify’s Ruby on Rails Shop model had grown beyond 3,000 lines, accumulated numerous responsibilities, and developed weak semantic boundaries, making store settings a target for extraction. The team used Flog’s ABC-based score—assignments, branches, and calls—to identify a particularly disordered area, then applied Martin Fowler’s Strangler Fig Pattern to move the locked\_settings behavior into Capital::SettingsToLock and a dedicated record/data source. The seven-step process defined and tested a new interface, redirected callers, introduced and backfilled the new data source, switched reads, and finally stopped legacy writes and removed the old column and code. Keeping the old system available during the transition supported incremental changes, monitoring, reversibility, and the stated no-downtime requirement; the completed example left the new system in place with legacy remnants removed.


### [The Evolution of Kit: Automating Marketing Using Machine Learning](https://yomu.fyi/post/the-evolution-of-kit-automating-marketing-using-machine-learning.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Mar 4, 2020

Kit began as a heuristic, rules-based virtual employee that simplified Facebook advertising for Shopify merchants by selecting products and budgets while defaulting other settings to best practices. The post describes its evolution into an artificially intelligent assistant that uses merchant spending behavior and store signals such as traffic and sales to recommend marketing actions. Kit's machine-learning design combines regression to predict likely spending with classification to estimate whether a budget and store state are likely to generate sales; training uses feature engineering, Apache Spark, Google Cloud ML Engine, and monitored model metrics. For real-time predictions, Bigtable stores engineered features, while a Tornado web container delegates model computation to TensorFlow Serving. The resulting system powered one third of Kit's marketing campaigns.


### [Creating Native Components That Accept React Native Subviews](https://yomu.fyi/post/creating-native-components-that-accept-react-native-subviews.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Feb 25, 2020

React Native’s standard native-module documentation does not explain how to reuse an existing native container while rendering React Native views inside it. This Android-focused Kotlin guide builds a native bottom-sheet component with a ViewGroupManager, inflating a CoordinatorLayout XML layout whose second child becomes the draggable sheet content. It overrides addView to place the first React Native child in the main container and subsequent content in the bottom sheet, then exposes the component through TypeScript with style and children props. A sheetState prop accepts collapsed or expanded, while BottomSheetBehaviour emits a BottomSheetStateChange event so native gestures update React state. The guide concludes that ViewGroupManager enables flexible React Native layouts around native functionality, while noting that platform parity remains important.


### [Your Circuit Breaker is Misconfigured](https://yomu.fyi/post/your-circuit-breaker-is-misconfigured.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Feb 18, 2020

Misconfigured circuit breakers can leave an application effectively unavailable during a dependency outage by allowing timed-out requests to consume worker capacity. Using Shopify’s Semian implementation, the post explains how name, error\_threshold, error\_timeout, half\_open\_resource\_timeout, and success\_threshold govern circuit opening, recovery, and wasted utilization across failing service instances. It models timeout spikes for a single worker, notes that separate names isolate services and instances, and presents an equation for steady-state additional utilization, while noting that context-switch costs are not included. A live test closely matched the equation’s prediction. In a Rails worker with two threads and 42 Redis instances, changing half\_open\_resource\_timeout from 0.25 seconds to 50ms and error\_timeout from 2 to 30 seconds reduced modeled extra utilization from 263% to 4%, with slower recovery; an author’s edit says success\_threshold does not affect steady-state utilization.


### [Great Code Reviews—The Superpower Your Team Needs](https://yomu.fyi/post/great-code-reviews-the-superpower-your-team-needs.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Feb 10, 2020

The article presents code review as a way to improve software quality, learning, and shared team responsibility, contrasting it with large, shallow pull requests that provide little actionable feedback. Its practices include keeping PRs small, using Draft or WIP PRs for early direction checks, limiting each PR to one concern, focusing comments on code rather than people, choosing reviewers with relevant context, and giving reviewers a clear map through the PR description. For data engineering, it gives an internal guideline of roughly 200–300 affected lines, while warning that excessively tiny PRs can obscure the overall picture. The stated benefits are faster, deeper reviews, easier rollback and iteration, better knowledge sharing, and a codebase that does not depend on one person, although the article frames these techniques as experiments teams should adapt.


### [Bug Bounty Year in Review 2019](https://yomu.fyi/post/bug-bounty-year-in-review-2019.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Feb 6, 2020

Shopify’s 2019 bug bounty review describes experiments and process improvements intended to increase program speed, while reporting changes in response, resolution, disclosure, and bounty metrics. Shopify-Experiments, a private program launched in mid-2019 for high-signal, high-impact hackers, tested expanded scope, full payment after triage, disclosure requirements, self-closing false positives, and collaboration with third-party developers. Using registration data, HackerOne API exports, and a Slack chatbot, the team improved program analytics and automated report-state changes, assignments, comments, bounty suggestions, and common invalid-report closures. Average first response fell to 16 hours, triage to 2 days and 13 hours, bounty payment to 7 days and 1 hour, and post-triage resolution to 20 days and 3 hours; disclosures rose to 74 bugs. For 2020, Shopify announced full bounty payment within seven days of triage, a $50,000 maximum bounty, higher payouts for several vulnerability classes, and added visibility for duplicate reports.


[Newer posts](https://yomu.fyi/company/shopify/page/14.md) · [Older posts](https://yomu.fyi/company/shopify/page/16.md)
