Glossary termTechnique

Feature Flag

Also known as: Feature toggle, Feature switch

Configuration switch in software that turns functionality on or off at runtime, allowing code to be deployed without immediately releasing it to users.

A feature flag, also called a feature toggle, is a conditional check in code whose outcome is controlled by configuration rather than by changing and redeploying the program. In its simplest form it is an if statement that consults a setting; in larger systems a dedicated flag service evaluates rules that can enable a feature for particular users, regions, percentages of traffic or internal staff. Flags separate deployment, the act of putting code into production, from release, the act of exposing a capability to users.

Flags serve several purposes. Release toggles hide unfinished work so that it can be merged into the main branch early, supporting trunk-based development and continuous integration. Experiment toggles divide users into groups for A/B tests. Operational toggles, sometimes called kill switches, let operators disable an expensive or failing feature during an incident. Permission toggles restrict features to certain customers or plans. Gradual rollouts controlled by flags resemble a canary release but work inside a single deployed version, and they can be reversed within seconds by changing a setting.

Feature flags carry real costs. Each flag adds a code path, and the number of possible combinations grows quickly, complicating testing. Flags that are never removed become technical debt, and old flags can be dangerous: a widely studied 2012 incident at the trading firm Knight Capital, in which a repurposed flag reactivated obsolete code on a server that had missed an update, caused heavy losses within an hour. Teams therefore track flag ownership, set expiry dates and remove flags once a feature is fully released, as part of mature continuous delivery practice.

Key points

  • Feature flags separate deploying code from releasing features to users.
  • Common types include release, experiment, operational and permission toggles.
  • Flags allow fast rollback of a feature without redeploying the application.
  • Stale flags add complexity and risk, so they should be removed once no longer needed.

Related entries

Glossary term

Deployment technique that releases a new software version to a small subset of users or servers first, expanding only if it behaves well.

Glossary term

Software engineering approach in which every change is built, tested and prepared so that it can be released to production safely at any time.

Glossary term

Continuous Integration

DevOpsProgramming

Development practice in which programmers merge changes into a shared repository frequently, with each change verified by an automated build and tests.

Glossary term

Release technique that runs two identical production environments and switches user traffic from the old version to the new one in a single step.

Glossary term

Technical Debt

Programming

Metaphor for the future cost of rework created when software teams choose a quick or expedient solution instead of a cleaner, more durable one.

Glossary term

Version Control

ProgrammingDevOps

System that records changes to files over time so that people can track history, revert mistakes and collaborate on the same codebase.

Featured in guides