A feature flag is a condition in code of the form “if the flag is on, the new logic runs”. The flag value comes from configuration or a separate service, so a new feature can reach users — or be withdrawn — within minutes. This is how feature release is separated from deployment: the code is deployed, but not yet visible to anyone.
Deployment separate from release
Normally, “deploying the code” and “giving users a new feature” are one and the same action. With a flag the two are separated: new code reaches the servers switched off and is then enabled gradually. This lets you:
- roll out a new feature not to everyone at once, but by user, team or percentage of traffic
- roll back a problematic feature with a single change, without redeploying the old version
- test new logic in production on a portion of traffic before enabling it fully
- keep an unfinished feature in the main branch — it is simply switched off by the flag
Types of flags
| Type | Purpose | Lifetime |
|---|---|---|
| Release flag | enable an unfinished or risky feature for some users | weeks, until fully enabled |
| Ops flag | switch a feature off during an incident — a kill switch | long-lived, lives in configuration |
| Experiment | compare variants by metrics, an A/B test | until the experiment ends |
| Permissions | show a feature only to a plan tier or a group of users | per product rules |
OpenFeature
To avoid being tied to a single flag service, the open standard OpenFeature defines a single API for working with flags: the application calls this API, while the provider — the flag service itself — is plugged in separately. The project is part of the CNCF, and SDKs are available for the major languages.
from openfeature import api client = api.get_client()if client.get_boolean_value("new-checkout", False): show_new_checkout()else: show_old_checkout()Sources
the term is written from these pagesVerified 18 Nov