What Is a Feature Toggle?
A feature toggle (or feature flag) is a configuration switch checked at runtime that controls whether a piece of functionality is active, without requiring a new deployment to change it. It lets teams merge and deploy code with a feature hidden, then enable it later, for everyone or a subset of users. This separates deploying code from releasing features.
Why it matters
Toggles let unfinished or risky code ship dark and be enabled gradually, which supports trunk-based development, canary rollouts, and instant rollback by flipping the flag rather than redeploying. The cost is added complexity: stale toggles accumulate and must be cleaned up once a feature is fully launched.
Related concepts
- Decouples code deploy from feature release
- Enables dark launches and gradual rollout
- Stale toggles must be retired to limit complexity