Course contentsShow
← Software Engineering
Lesson 710 of 1,93322. Continuous Delivery and DeploymentFree lesson

Canary Releases

Deploy changes to a small subset of users first, monitor for issues, then gradually roll out to everyone.

Canary Releases

What you'll learn: You'll learn how to safely deploy changes to production by testing them with a small group of users before rolling out to everyone.


The Core Idea

A canary release is a deployment technique where you send new code to a tiny fraction of your users first—maybe 5% or even 1%—while the rest continue using the stable version. You monitor metrics like error rates, performance, and user behavior. If everything looks good, you gradually increase the percentage until 100% of users have the new version. If something goes wrong, you can quickly roll back before most users are affected.

The name comes from the historical practice of coal miners bringing canaries into mines; if dangerous gases were present, the canary would show distress first, warning the miners.

How It Works

  1. Deploy to a subset: Route a small percentage of traffic to the new version
  2. Monitor closely: Watch error rates, latency, business metrics
  3. Gradual expansion: If healthy, increase to 10%, then 25%, 50%, etc.
  4. Full rollout or rollback: Complete the deployment or revert if issues arise

Why Use Canary Releases?

Unlike Blue-Green Deployment (which switches all traffic at once), canary releases limit your blast radius. If a bug slips through your pipeline stages, only a small group experiences it. You catch real-world issues before they impact your entire user base.

This approach requires routing infrastructure that can split traffic by percentage and robust monitoring to detect problems quickly. The gradual rollout gives you confidence that your change is truly production-ready.

Key Takeaway: Canary releases minimize risk by deploying changes to a small user subset first, allowing you to validate in production before committing to a full rollout.