Feature Flag
Feature Flag
A mechanism for enabling or disabling features without rewriting code.
In Simple Terms
A feature flag works like an on/off switch that lets you enable or disable specific features without changing any code. For example, you can use feature flags to roll out a new feature to a select group of users before a full release, or to instantly turn off a feature the moment a problem is discovered — all without taking down the entire service.
Behind the Name
The name 'Feature Flag' combines 'Feature,' meaning a capability or function, with 'Flag,' which acts as a marker or signal for switching. The idea comes from placing a specific flag inside the program — when the flag is raised, the feature is active; when it is lowered, the feature is turned off.
Take a Closer Look!
A feature flag is a technique for controlling program behavior from outside the source code — enabling or disabling specific features without modifying the codebase.
By embedding conditional logic in the program — such as 'if this setting is on, run Feature A' — you can freely switch the output at any time afterward.
With this mechanism, you can ship unfinished features to a production system while keeping them completely hidden from users.
When you're ready to launch, a simple configuration change makes the new feature available instantly, which is why feature flags are widely used in large-scale development environments.
Feature flags are also used for targeted rollouts — exposing a new feature to a specific group of users to observe their response — and for gradual releases that expand access incrementally to manage system load.
If an unexpected error is discovered in a new feature, simply turning the flag off restores the previous state, keeping the impact of any issues to a minimum.