---
title: "Shopify's Playbook for Scaling Machine Learning"
description: "Shopify'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."
url: "https://swe.quest/articles/shopify-s-playbook-for-scaling-machine-learning-01ef31091481dd96"
canonical: "https://shopify.engineering/shopify-playbook-scaling-machine-learning"
source: "Shopify Engineering"
published: "2022-02-11"
difficulty: "easy"
kind: "Case study"
reading_minutes: 12
tags: ["ml-platform","machine-learning","threat-detection","ecommerce"]
---

# Shopify's Playbook for Scaling Machine Learning

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2022-02-11, 12 min read, Case study. Original: [https://shopify.engineering/shopify-playbook-scaling-machine-learning](https://shopify.engineering/shopify-playbook-scaling-machine-learning)

## Summary

Shopify'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.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [ML platforms](https://swe.quest/tags/ml-platform.md) (AI & ML)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [Threat detection](https://swe.quest/tags/threat-detection.md) (Security)
- [E-commerce](https://swe.quest/tags/ecommerce.md) (Domains)

## Prerequisites

- basic machine learning concepts ([easy posts on Machine learning](https://swe.quest/tags/machine-learning.md?difficulty=easy))
- model training and deployment ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))

## Keywords

Shopify, PMML, Apache Airflow, Ruby on Rails, Trino, logistic regression

## Related posts

- [5 Steps for Building Machine Learning Models for Business](https://swe.quest/articles/5-steps-for-building-machine-learning-models-for-business-9d6ce609a5ab2c3d.md): Shopify Engineering · 2021-08-25 · Medium · 15 min read · Machine learning, ML platforms, Evaluation
  A five-step workflow for building ML models in a business context: confirm ML is warranted (defer it for brand-new products and beat a heuristic baseline first), start with simple models and basic features or off-the-shelf pretrained components, and pick a metric tied to business impact before optimizing.
- [Unlocking Real-time Predictions with Shopify's Machine Learning Platform](https://swe.quest/articles/unlocking-real-time-predictions-with-shopify-s-machine-learning-platform-f4124fdd81e9cd3f.md): Shopify Engineering · 2023-03-10 · Medium · 13 min read · ML platforms, Inference & serving, Kubernetes, Deployment, Python
  Shopify extended its Ray-based Merlin ML platform with online inference, running each real-time model as a dedicated service in its own namespace on GKE that loads models from the Comet ML registry and can read features from the Feast-based Pano store.
- [The Magic of Merlin: Shopify's New Machine Learning Platform](https://swe.quest/articles/the-magic-of-merlin-shopify-s-new-machine-learning-platform-f17a810670837d2b.md): Shopify Engineering · 2022-04-06 · Medium · 13 min read · ML platforms, Kubernetes, Model training, Python
  Merlin is Shopify's redesigned ML platform built on open source tools.
- [Rocket Money x Hugging Face: Scaling Volatile ML Models in Production​](https://swe.quest/articles/rocket-money-x-hugging-face-scaling-volatile-ml-models-in-production-acc7e904259d3114.md): Hugging Face · 2023-09-19 · Easy · 8 min read · Inference & serving, ML platforms, Machine learning, Caching, Payments & fintech
  Rocket Money replaced a regex-and-decision-table merchant detector with a BERT-family transformer classifier spanning 4000+ classes, served through Hugging Face's hosted Inference API rather than an in-house MLOps stack.
- [Training Orchestrator: Unifying Model Training at Yelp](https://swe.quest/articles/training-orchestrator-unifying-model-training-at-yelp-28e0641de090c84f.md): Yelp Engineering · 2026-07-14 · Medium · 12 min read · ML platforms, Model training, Python, Testing
  Yelp's Training Orchestrator replaces per-team monolithic Spark training scripts with a declarative, configuration-driven framework.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
