Model Deployment
Intermediate 15 min read Model Deployment

Deployment Strategies: Canary and Shadow

Releasing models by measuring, not hoping

Canary and shadow deployments expose a new model to real traffic safely: shadow logs predictions in parallel without user impact; canary shifts a slice of live traffic and watches outcomes. Both make 'release' a measurement, not a leap.

canaryshadow deploymenttraffic splitrolloutA/Bprobability
Before we start

What you will learn

  • Distinguish shadow from canary traffic handling
  • Design a canary with a promotion/rollback rule
  • Use shadow mode to evaluate without affecting users
Introduction

What is this?

A shadow deployment runs the new model alongside production, recording its predictions to compare later without serving them to users. A canary routes a controlled percentage of live traffic to the new model and watches outcomes. Both give real-traffic evidence before a full rollout.

Motivation

Why do you need it?

  • Offline evals can't see production data — shadow and canary see it live.
  • Shadow is zero-risk for users; canary is low-risk and measurable.
  • Promotion becomes 'metrics held', not a vibe check.
  • Both produce the evidence your approval gates want.
Think about it

Mental model

Imagine

A trainee chef shadowing the line before working the pass

Think of

Shadow then canary

First she watches and preps the exact same plates without a ticket (shadow — no one eats them). Then she plates for real but only for one table in ten (canary). Promotion happens when the tables don't complain and plates match spec.

Mechanics

How it works

  • Shadow: a mirror of production traffic is duplicated to the candidate; its outputs are logged, not returned.
  • Canary: a fraction of real traffic (e.g. 5%) is routed to the candidate and its live outcomes are compared.
  • Both pipeline predictions through the same monitoring and metric pipeline as production.
  • A decision rule (metric holds over a window) either stretches the canary or rolls back.
  • Full rollout: traffic shifts to the candidate; the old model becomes the rollback target.

Shadow then canary progression.

Candidate ready
Shadow
Compare offline
Canary 5%
Gate rule
Full rollout
Real world

In production

  • A team shadows a new churn version for 48h, compares lift, then canaries it at 10%.
  • A risk platform canaries 1% of live traffic — metrics hold, then auto-promotes to 100%.
  • A shadow run reveals a feature-skew bug between train and serving before any user sees it.
Guidelines

Best practices

  • Shadow first, canary second — risk-free evidence before any live exposure.
  • Define the promotion rule before the canary starts: metric, window, threshold.
  • Log outcomes, not just predictions — you compare effects, not scores.
  • Keep rollback one step: the previous production version, fully warmed.
Watch out

Common mistakes

  • Canarying on score distributions when the business metric is what matters.
  • Shadow used forever, never promoted, while the champion rots.
  • A 'canary' that's really 100% because someone forgot the split.
  • Promotion on a 10-minute window — noise, not evidence.
When things break

Debugging tips

  • Canary 'wins' but prod hurts — the canary traffic slice isn't representative or outcomes weren't logged.
  • Rollback slow — you didn't pre-warm the old version; make rollback a pinned, ready revision.
  • Shadow shows skew — compare train vs shadow input distributions; that's the bug report.
Interviews

Interview checkpoint

Test yourself

Quick quiz

0/2
1

When is a review new model safe to run with zero user impact?

2

A canary's promotion rule should be decided before the rollout starts.

Go deeper

Official documentation