Canary Deployment

Canary Deployment is a release strategy that routes a small fraction of traffic to a new version first, observes its behaviour against the old version, and gradually expands the new version's share if metrics stay healthy. The name comes from "canary in a coal mine": the small early group surfaces problems before the rest of the population is exposed.

How it works

  1. Deploy the new version alongside the existing one.
  2. Route a small percentage of traffic (1%, 5%) to the new version.
  3. Compare key metrics (error rate, latency, business KPIs) between the two cohorts.
  4. Gradually shift more traffic if healthy; roll back instantly if not.
  5. Once 100% is on the new version, retire the old.

Traffic routing options

  • Random percentage. Hash request IDs to a bucket and route based on that.
  • Sticky. Once a user lands on a version, keep them there for session consistency.
  • Targeted. Internal employees first, then beta users, then a percentage of all users.

Common tools

  • Argo Rollouts, Flagger, Istio, Linkerd, AWS App Mesh, LaunchDarkly (for feature-flag-driven canaries)

Subscribe to Sahil's Playbook

Clear thinking on product, engineering, and building at scale. No noise. One email when there's something worth sharing.
[email protected]
Subscribe
Mastodon