Course contentsShow
← Machine Learning and Deep Learning
Lesson 3084 of 3,53867. A/B Testing and Deployment StrategiesFree lesson

Canary Deployment

Gradually roll out the new model to a small percentage of traffic, monitoring performance before increasing exposure.

Canary Deployment

What you'll learn: How to safely roll out new ML models by gradually exposing them to increasing traffic while monitoring performance.

The Core Idea

A canary deployment is a progressive rollout strategy where you route a small percentage of production traffic (e.g., 5%) to your new model while the majority continues using the existing model. If the canary performs well, you incrementally increase its traffic share; if problems arise, you quickly roll back with minimal user impact.

The name comes from "canary in a coal mine" — miners used canaries to detect dangerous gases early. Similarly, a small user group acts as an early warning system for your model.

How It Differs from Shadow Deployment

Unlike shadow deployment (where the new model runs in parallel but doesn't serve users), canary deployment actually serves real predictions to real users — just to a controlled subset. This gives you genuine user impact data, not just operational metrics.

The Typical Flow

  1. Initial canary (5% traffic) → Monitor for hours/days
  2. Expand gradually (10% → 25% → 50%) if metrics hold
  3. Full rollout (100%) once confidence is high
  4. Instant rollback if any stage shows degradation

You're continuously comparing business metrics, latency, error rates, and model performance between the canary and the stable baseline.

When to Use Canary Deployment

This strategy shines when:

  • You've validated the model offline and in shadow mode
  • The cost of mistakes is moderate to high
  • You need real user feedback but want risk mitigation
  • Your infrastructure supports traffic splitting

Key Takeaway: Canary deployment balances safety and speed by incrementally exposing a new model to real traffic, allowing you to catch issues early while limiting blast radius.