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.
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
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.
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.
Mental model
A trainee chef shadowing the line before working the pass
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.
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.
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.
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.
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.
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.
Interview checkpoint
Quick quiz
When is a review new model safe to run with zero user impact?
A canary's promotion rule should be decided before the rollout starts.