Cloud & infrastructurefeature togglekill switchfeature switchbrownout

Feature flag

Definition

A feature flag is a configuration value checked at runtime that decides whether a code path runs, letting teams separate deploying code from releasing features and disable features quickly.

In practice

Flags let code ship dark and be released gradually to internal users, a percentage of customers or one region. In graceful degradation they act as kill switches: under load or during an incident, expensive or failing features are turned off in seconds, ideally automatically, instead of waiting for a fix and a deploy.

Every flag doubles the number of code paths to test, and stale flags pile up as technical debt, so give each one an owner and a removal date. The flag service itself becomes a dependency: evaluate flags locally from a cached configuration and choose a safe default when it is unreachable.

Example

During a database incident, on-call flips recommendations.enabled to false; product pages stop making 6 recommendation queries per view and render with a static bestseller list.