Vezi pagina în română

IT Glossary

What is a feature flag (feature toggle)?

A switch inside the code that turns a piece of functionality on or off in a live application, without a new release and without a developer being involved.

6
sections
6
questions answered

A feature flag (also called a feature toggle) is a condition in the code, evaluated at runtime, that switches an already shipped feature on or off for everyone, a percentage of users or one customer, without a new release. It is controlled from outside the application, so functionality can ship in a dormant state and be switched on later for one internal team, then five percent of customers, then everyone, and switched off again in seconds if the support queue starts filling. Deployment and release stop being the same event, which is the whole point.

Three consequences follow that matter outside engineering. Risk drops sharply, because the response to a problem discovered at scale is a toggle rather than an emergency deployment. Timing moves to the people who own the outcome: marketing can enable a campaign feature on the morning of the launch without booking a developer. And experimentation becomes cheap, because showing two variants to two audiences is the same mechanism with a different rule. The cost is discipline — flags left switched on forever quietly become the most confusing kind of technical debt.

Why it matters for your business

Instant withdrawal when something breaks

A problem found in production is switched off in seconds rather than waiting for a hotfix build, review and deployment cycle.

Gradual rollout with controlled risk

New functionality reaches a small share of users first, so defects surface at a scale where they are annoying rather than expensive.

Business decides the moment, not IT

Launch timing sits with the team responsible for the campaign or the contract, without a release window to negotiate.

How a feature flag works

At runtime the application code asks a flag service or a configuration: is feature X on for this user? The answer depends on an evaluation context such as user id, country, plan or device. In code it reads simply: “if flags.enabled("new-checkout", user) then show the new checkout, otherwise the old one”.

Typical rules are on or off for everyone, on for a percentage of users (gradual rollout), on for a list of accounts, and a kill switch, a flag that turns a failing part off in production. Flag state can live in a database row, a property in a config file or an external service (Wikipedia, “Feature toggle”).

Every flag doubles the paths through the code: both branches must be tested, which is why feature flags go together with regression testing.

Feature flag types and how long they live

Pete Hodgson, on martinfowler.com (2017), sorts flags into four categories by how long they live. Release toggles are temporary and removed after the launch. Experiment toggles support an A/B test and live until the test ends. Ops toggles control operational behaviour, for example degrading a feature under heavy load; most are short-lived, a few are kept on purpose. Permissioning toggles give features to premium or beta users and can live for years.

The hygiene rule: every flag gets an owner and an expiry date, and removing it is part of finishing the feature. A forgotten flag is more than extra code. On 1 August 2012 Knight Capital lost over 460 million US dollars in about 45 minutes: new code repurposed a flag that had once activated a function unused since 2003, and one of eight servers had not received the new code (SEC, order 34-70694, 16 October 2013).

Want an estimate for your project?

Message us on WhatsApp. We reply the same working day, and the first 30-minute call is free.

Book a free call

Feature flag vs feature toggle, configuration, branch and deploy

Feature flag, feature toggle, feature switch and feature gate are synonyms for the same technique (Wikipedia). A static configuration value is the same for everyone and usually needs a restart or redeploy. A flag is evaluated per request or user and changes without a restart.

Compared with a long-lived feature branch, a flag lets you merge unfinished code into the main branch, hidden behind the flag. That is trunk-based development, and it supports continuous integration. As for deployment: a deploy puts code into production, a flag decides who sees it. The full topic of deployment is covered in this glossary under deployment.

OpenFeature: the open standard for feature flags

OpenFeature is an open, community-driven specification with a vendor-neutral API and SDK for evaluating flags. It works with commercial tools, open-source tools or an in-house system through providers. The SDK abstractions are the Evaluation API, Evaluation Context, Providers, Hooks and Events.

For a small business the point is simple: the code calls one API, so changing the flag vendor or moving from an in-house table to a service does not mean rewriting every flag check. There is no vendor lock-in at code level.

OpenFeature is a CNCF project, accepted on 17 June 2022 and incubating since 21 November 2023, under the Apache 2.0 licence. Checked on 18 November 2026 at openfeature.dev and cncf.io.

Frequently asked questions

What does feature flag mean?

A feature flag is a condition in the code, evaluated at runtime, that switches a shipped feature on or off without a new release. It is also called a feature toggle, feature switch or feature gate, and it can target everyone, a percentage of users or a single customer.

What is the difference between a feature flag and a feature toggle?

There is no technical difference: they are two names for the same technique (Wikipedia; Pete Hodgson's article on martinfowler.com is titled “Feature Toggles (aka Feature Flags)”). LaunchDarkly separates them only in wording: the toggle is the practice, the flag is the mechanism in the code.

How are feature flags managed in practice?

Small teams start with configuration entries or database rows and an internal admin screen, which is entirely adequate for a handful of flags. Dedicated services add targeting rules, gradual percentages, audit history and experiment reporting. The upgrade usually becomes worthwhile when non-technical staff need to operate the switches themselves. With OpenFeature the same application code works with any of these tools.

Do feature flags complicate code maintenance?

They do if nobody removes them. Each flag doubles the paths through a piece of code, and a system with forty stale flags has an untestable number of combinations. The working rule is that every flag is created with an expiry date and an owner, and that removing it is part of finishing the feature rather than a task that waits for a quiet week.

Can I use feature flags for A/B testing?

Yes — the targeting machinery is identical, and most commercial flag services include experimentation for that reason. The difference is intent: a release flag protects a rollout and is removed afterwards, while an experiment flag exists to measure two variants against a metric and ends with a decision. Keeping the two categories labelled separately prevents an unfinished experiment from becoming permanent.

What is OpenFeature?

OpenFeature is an open specification and SDK for feature flags, a CNCF project incubating since 21 November 2023. It gives a vendor-neutral API for evaluating flags, so you can switch providers without changing the flag checks in your code.