Feature toggle
A feature toggle (also called a feature flag) is a programming mechanism that lets you enable or disable selected application features while the app is running, without modifying and redeploying the code. Instead of removing an unfinished feature from the codebase, you place it behind a conditional statement controlled by a flag. This lets teams deploy code to production frequently and in small increments, while deciding when to actually expose a feature to users independently of the moment of deployment.
How a feature toggle works
A flag is usually a value stored in configuration, a database or a dedicated flag-management system. Application code checks its state and, based on it, decides whether a given logic path should run. Changing the flag value immediately affects the app's behaviour without a new deployment. This is a foundation of modern CI/CD practice, where deploying code is decoupled from releasing it.
Types of flags
There are release flags (hiding unfinished features), experiment flags (for A/B testing), operational flags (an emergency kill switch that disables demanding features) and permission flags (feature access for specific plans or users). They differ in lifecycle and how they are managed.
Practical applications
Feature toggles are used for gradual rollouts (canary releases), where a feature is first shown to a small percentage of users and the reach is then increased. Flags also enable instant disabling of a problematic feature without rolling back an entire deployment, and giving beta versions to selected customers. In practice, DevOps teams treat flags as a core element of safe, continuous delivery that reduces the risk of every deployment.
Powiązane pojęcia
Najczęstsze pytania
How is a feature toggle different from a regular settings option?
A settings option is part of the product and aimed at the end user. A feature toggle is a developer and operations tool — it controls rollout, testing and emergency disabling of features, often invisibly to the user.
Do feature flags need to be removed?
Yes, at least the temporary ones. Flags used to roll out a feature should be removed once it is fully released, so the codebase does not accumulate dead branches. Permanent flags, such as those gating premium features, may stay in place indefinitely.
