Decoupling deploy from release
A feature flag is a runtime switch that turns a feature on or off without redeploying code. This separates deployment, shipping the code, from release, making the feature visible to users. You can deploy dark code and flip it on later.
Targeted rollout
Flags can target subsets of users:
- Percentage rollout enable the feature for ten percent, then fifty, then everyone.
- User segments turn it on for internal staff or beta testers first.
- Kill switch instantly disable a misbehaving feature without a deploy.
Operational uses
- A B testing show variants to different groups and compare outcomes.
- Gradual rollout combine with monitoring like a canary at the application layer.
- Emergency control flip a kill switch when something breaks.
Watch out
Flags add code paths that must be cleaned up. Stale flags accumulate as technical debt, so retire them once a feature is fully launched and stable.
Key idea
Feature flags toggle behavior at runtime, decoupling deployment from release to enable targeted rollouts, A B tests, and instant kill switches, but they must be cleaned up to avoid debt.