Feature Flags
A deployment technique that decouples code release from feature exposure, allowing teams to toggle features on or off for specific users without redeploying — enabling dark launches and progressive rollouts.
What Is a Feature Flag?
A feature flag (also called a feature toggle or feature switch) is a conditional in code that lets you turn a feature on or off for specific users without deploying new code. It decouples the moment code ships from the moment users experience it, which transforms how teams release, test, and de-risk changes. Feature flags are the infrastructure beneath modern progressive rollout, canary release, and experimentation programs.
Also Known As
- Marketing teams call them kill switches or rollout controls.
- Growth teams say feature flags or experiment flags.
- Product teams use feature toggles or gates.
- Engineering teams refer to them as flags, toggles, or switches.
- SRE teams call them kill switches or circuit breakers.
How It Works
You want to ship a redesigned onboarding flow to 10,000 enterprise users. You deploy the code with a flag called `new_onboarding_v3` default-off for everyone. On Monday you enable it for your internal team (5 users) and verify it works. Tuesday you enable for 1% of users — ~100 accounts — and monitor error rates. Wednesday you expand to 25%, Thursday to 100%. If at any step error rates spike, you flip the flag off in under 30 seconds. The code is the same — only the flag configuration changes.
Best Practices
- Every flag needs an owner, an expiration date, and a tracking ticket for removal.
- Use a managed service (LaunchDarkly, Statsig, Unleash) rather than building your own.
- Name flags with a convention like `area_feature_version` for discoverability.
- Log every flag evaluation so you can audit who saw what and when.
- Build a standing flag-cleanup session into your sprint cadence.
Common Mistakes
- Letting flags accumulate indefinitely — stale flags become permanent technical debt.
- Shipping without a kill switch, meaning a bug requires a full rollback instead of a config change.
- Using flags for permanent product configuration, which blurs them with settings and config.
Industry Context
- SaaS/B2B: Essential for enterprise customers who need staged rollouts and per-account exposure control.
- Ecommerce/DTC: Used for geographic rollouts, promotion activation, and seasonal feature toggles.
- Lead gen: Less critical — marketing pages usually don't need the rollout machinery.
The Behavioral Science Connection
Progressive rollouts leverage the mere exposure effect: gradual, repeated exposure to something new increases preference for it. Organizations that roll out features gradually — internal first, then beta, then everyone — build familiarity before the feature faces full user scrutiny. This is change management informed by psychology, not just engineering risk management.
Key Takeaway
Feature flags decouple code release from user exposure — every flag is a potential experiment, a potential kill switch, and a potential piece of technical debt if you forget about it.