Skip to content
Careersadvanced

What is a canary release?

Updated Nov 30, 20264 min readBased on official documentation
What is a canary release?

In short

A canary release is a way to ship a new software version by first sending it to a small group of users, then widening the rollout step by step. If problems appear, traffic goes back to the old version. The name comes from miners who used canary birds to detect toxic gas early.

A canary release is a deployment technique that lowers the risk of putting a new software version into production. Instead of sending the change to everyone at once, you roll it out slowly. First, a small group of users sees the new version. When the team is confident, more users and more servers follow. The approach is useful for advanced teams that already run frequent, automated releases and want a safety net for every change.

How it works

The process starts with infrastructure. You deploy the new version to a subset of your servers, but no users are routed to them yet. This lets you check that the new code starts, runs and behaves as expected in the real environment. Once you are satisfied, you begin sending a small share of traffic to those servers. As confidence grows, you add more servers and route more users to them. At the end, every user runs the new version, and the old infrastructure can be decommissioned.

The key idea is that the router decides who sees what. Moving traffic back to the old version is usually enough to recover from a bad release, because the old version is still running while the rollout is in progress.

Choosing the first users

There are several ways to pick the first group of users. The simplest is a random sample. Some companies release to internal staff first, so employees catch problems before customers do. A more advanced approach selects users by profile or demographics, for example by account type or country.

In large, distributed systems, routing by user is not always the best option. Teams often partition the rollout instead. If your users are spread across regions, you can release to one region first. If you run several brands, you can release to a single brand first. Some organizations use several canaries in sequence. Facebook, for example, is described as exposing its first canary only to employees, with all feature flags turned on so that problems with new features show up early. Feature flags are a related idea that you can read about in our guide on feature flags.

Canary releases as a testing tool

A canary rollout is also a form of capacity testing. By slowly increasing load on the new version, you can watch metrics such as response times and error rates and see how the new code affects the production environment. This is an alternative to building a separate testing environment that tries to copy production. The canary runs on real production infrastructure, so the results are closer to reality.

Monitoring is what makes this work. Without good metrics, a canary is just a slow deployment. Teams usually decide ahead of time which signals matter and what level of change should trigger a rollback. Clear targets for reliability help here, and our article on service level objectives explains how to define them.

Canary releases are sometimes confused with A/B testing, because the technical setup looks similar. The goals differ. A canary release checks whether a change is safe. A/B testing checks whether a hypothesis about user behavior is true. Mixing them can distort results. A/B tests can also take days to reach statistical significance, while a canary is usually expected to finish in minutes or hours.

Common mistakes

The first drawback is that you must run and manage several versions of your software at the same time. Keeping the number of concurrent versions low makes this easier to handle. Database changes need extra care too. A common technique is to use parallel change, where the database and the application are updated in compatible steps, so both old and new versions can work during the rollout.

Another difficulty appears when you ship software to devices you do not control, such as desktop apps or mobile apps. You cannot choose when users upgrade. In this case, the backend may need to support both old and new client versions for a while. You can track which client versions are in use and reduce backend support once usage drops to a low level.

A further mistake is ignoring the rollback plan. The rollback should be simple and tested before you start. If it depends on manual steps that nobody has practiced, a small problem can grow into a large incident. Teams that work with on-call rotations often rehearse these steps so that whoever is awake at night can act quickly.

Alternatives

Canary releases are not the only option. A blue-green deployment switches all traffic between two complete environments at once, which is simpler but gives less gradual exposure. Feature flags let you turn a feature on for some users without redeploying code, and they are often used together with canaries. Full rollouts without a safety net are faster to finish but riskier. Choose the approach that matches how much risk your system can tolerate and how well you can observe it.

The name comes from coal miners, who carried canary birds into mines. If toxic gas leaked, the bird reacted first and warned the miners. A canary release plays the same role, giving an early signal before a problem reaches all users.

FAQ

Is a canary release the same as a blue-green deployment?

No. A blue-green deployment switches all traffic between two full environments at once. A canary release shifts traffic gradually, so only a small share of users sees the new version at first.

How do I know when to move to the next stage of a canary rollout?

Teams usually define metrics and thresholds before the rollout begins. If the new version stays within those limits for long enough, the rollout moves on. If not, traffic goes back to the old version.

Can I use canary releases for mobile apps?

It is harder, because users decide when to update. Backends often need to support both old and new client versions until usage of the old version drops to a low level.

Is a canary release a kind of A/B test?

They look alike technically but serve different goals. A canary checks that a change is safe, while an A/B test checks whether a hypothesis is true. Keeping them separate avoids confusing results.

Sources

This page is based on the official documentation below. Read it for full detail.

Canary release — official documentation ↗
blozhikDeveloper news from across the web, explained. Every story links to its original sources.