Product & innovation · Product strategy & innovation
Feature flags and staged rollout
Best for Startup to Growth
Use it when
You are shipping a risky change to a live product and want a few users to get it first, watch the effect, and switch it off fast if it fails.
Skip it when
- You need to know whether a change lifts a business metric, with a control group sized for significance. Use A/B testing framework.
- You are still testing whether customers want the product at all. Use Lean Startup methodology, which staged rollouts can then serve.
- You need the market launch plan, with messages, channels and dates. Use Launch strategy framework.
- You need the pipeline that builds, tests and deploys code. Use Continuous integration/continuous deployment (CI/CD).
What to apply first and what to use instead are listed below.
Approaches
Percentage rollout
The flag serves the change to a random share of users, picked by hashing each user ID so the same users keep it, and the share rises in steps.
- Pro Each stage is a fair sample, so exposed users compare cleanly with everyone else.
- Con Users cannot choose, and important accounts may land in an early stage.
Ring rollout
The change opens to fixed groups in order, such as the team's own accounts, then customers who opt in to previews, then everyone.
- Pro The first users expect rough edges and give feedback freely.
- Con Early rings are small and unusual, so problems that appear only under real load can slip through.
Inputs
- Change behind a flagThe change wrapped in a flag whose off state keeps current behavior, from engineering.
- Health metricsA short list of user-visible signals, such as error rate and latency, plus the usage signal the change should move, from monitoring and analytics.
- Stage planThe users or share of users in each stage and the minimum time each stage runs, agreed by product and engineering.
- Rollback ruleThe gap between exposed and unexposed users that pauses or reverses the rollout, and who makes the call.
- Flag registerOptionalLive flags with owner, type and removal date, from your flag tool.
Steps
- Put the change behind a flag whose off state keeps current behavior, and add a dated task to remove the flag.
- Write the stage plan and the rollback rule before the first user sees the change.
- Release to a small first stage, and compare its health metrics with unexposed users over the same window.
- Widen to the next stage only when exposed users match the rest on clear signals such as crashes and failed requests, and read slower signals such as usage in later stages.
- Switch the flag off at once if the rollback rule triggers, fix the cause and restart from the first stage.
- Remove the flag and the old code path once everyone has the change.
Output
A rollout log for one change that records each stage, its metrics against unexposed users and the decision taken.
- Change and flag name
- Stage and exposed group
- Start and end dates
- Health metrics, exposed versus unexposed
- Usage signal
- Decision (widen, hold or roll back)
- Flag owner and removal date
Done when
- The flag has an owner, an off state that matches current behavior and a removal date.
- Every stage records its exposed group, dates and metrics beside unexposed users.
- Every widen, hold or roll back decision cites the rollback rule.
- The flag and old path are removed after full release, or a dated reason to keep them is logged.
Measure
Over the next two quarters, track failed releases, the share of users each failure reached and the time to switch a bad change off. Compare with your releases from before staged rollout. It worked when each failure reaches fewer users and is switched off in minutes without a redeploy. Count live flags each month as well, and act if the count keeps climbing.
Hypothetical example
Trailmark, a hiking app, rebuilt its route search behind a flag. The stage plan ran from staff accounts to users who opted into previews, then a random 10 percent, then everyone, with at least three days per stage. The rollback rule was a search error rate one point above unexposed users. Staff and preview users found two display bugs, fixed before the random stage. At 10 percent, errors matched the rest, but search slowed on busy weekends. The team held the stage, added caching and widened a week later. After full release, they deleted the flag and the old search code in the same sprint.
Common mistakes
- Leaving flags in the code after full release. Give each flag a removal date and cap the number of live flags.
- Judging the first stage on whole-service averages, which hide its failures. Compare exposed users with unexposed users directly.
- Comparing the first stage with last week's figures. Compare it with unexposed users over the same window, since time adds noise.
- Testing only the new path. Test the expected production setting and the fallback with the flag off.
- Running several rollouts on one service at once. Run one at a time so each signal points to one change.
Sources
- Feature Toggles (aka Feature Flags) · Pete Hodgson, 2017
- Canarying Releases (The Site Reliability Workbook, chapter 16) · Alec Warner and Štěpán Davidovič, with Alex Hidalgo, Betsy Beyer, Kyle Smith and Matt Duftler, 2018
- Progressive experimentation with feature flags · Microsoft Learn, 2022
Show all 4 sources
- Percentage rollouts · LaunchDarkly documentation
By company stage
Apply first
Nothing. You can start here.
Use instead
- A/B testing framework
You need to know whether a change lifts a business metric, with a control group sized for significance. Use A/B testing framework.
- Lean Startup methodology
You are still testing whether customers want the product at all. Use Lean Startup methodology, which staged rollouts can then serve.
- Launch strategy framework
You need the market launch plan, with messages, channels and dates. Use Launch strategy framework.
- Continuous integration/continuous deployment (CI/CD)
You need the pipeline that builds, tests and deploys code. Use Continuous integration/continuous deployment (CI/CD).
Where it sits
Open the product strategy & innovation roadmapRecommended resources
No sponsored resources on this framework yet. Sponsored listings would be labelled here, never in search.
Progress is not saved until you have an account. Create a free account