LOOP · The DevOps Codex
Ch 06 · Feature Flags & Progressive Delivery
Chapter 06 · The Release Toggle

Feature Flags — decouple deploy from release, decouple release from drama

A feature flag is a runtime conditional that decides whether a code path is active. Add flags and you can deploy a hundred times a day while still releasing on Tuesday at noon to 5% of Germany. Combined with canary deploys and observability, flags become the progressive-delivery primitive — the smallest unit of risk you can ship.

6.1 · Why flags

Definition. A feature flag (a.k.a. feature toggle, feature gate) is a configuration value evaluated at runtime that determines whether a branch of code executes or which variant is served. The mechanism is trivial — an if — but the implications restructure the release process.

  • Deploy ≠ Release. Code merges and ships dark; you flip the flag when you (or marketing, or compliance) are ready.
  • Kill switch. A regression caught in production is disabled in seconds, no rollback artefact required.
  • Experiment platform. A/B/n tests run on the same plumbing that gates releases.
  • Trunk-based enabler. Long-lived feature branches become unnecessary — a half-built feature ships behind a flag set to off.
  • Permission & entitlement. Plan tiers, beta access, geo restrictions all become flag rules instead of bespoke code.
The Forsgren-style payoff: teams with mature flagging consistently report higher deployment frequency and lower change-failure rate (DORA 2023, Accelerate State of DevOps). Flags do not cause elite performance, but they remove the most common reason teams batch changes.

6.2 · The flag taxonomy

TypePurposeLifetimeOwner
Release flagHide an in-progress feature until ready; ramp to 100% then remove.Days–weeksFeature team.
Experiment flagServe variants to measure causal impact on a metric.1–4 weeks per testProduct / data.
Operational flagToggle expensive code paths (e.g. enable verbose logging, switch cache provider).MonthsSRE / platform.
Permission / entitlementGate features by plan, role, contract.PermanentProduct / billing.
Ops kill switchEmergency disable for a subsystem (payments, recommendations).Permanent, rarely flippedSRE.
Type confusion is the #1 flag failure mode. A release flag that lingers becomes an operational flag becomes dead code. Tag the type in your platform; enforce expiry on release flags.

6.3 · The 2026 feature-flag landscape

PlatformVendorEval modelNotable
LaunchDarklyLaunchDarklyLocal + streaming SSEMarket leader, Code References, Experimentation suite.
StatsigStatsig (Meta-origin)Local; rules pushedStrong experimentation (CUPED, sequential testing), free tier.
GrowthBookGrowthBook OSSLocal SDK + warehouseOpen-source, warehouse-native (BigQuery, Snowflake).
UnleashUnleash OSSLocal pollingOSS, self-host friendly, FedRAMP-conscious enterprises.
ConfigCatConfigCatPolling + CDNSimple, cheap, CDN-distributed config.
FlagsmithFlagsmith OSSLocal + edgeOpen-source, remote-config use cases.
Split.ioHarness (acq. 2024)Local streamingImpressions + Feature Data Platform.
AWS AppConfigAWSPolling, deployment strategiesNative IAM, Lambda extension, validators.
Azure App ConfigurationAzurePolling + push refreshTime/targeting filters, Key Vault refs.
Vercel Edge ConfigVercelEdge-replicated K/VUltra-low-latency reads at the edge.
Optimizely Feature ExperimentationOptimizelyLocal SDKMature experimentation heritage.
PostHog Feature FlagsPostHog OSSLocal + remoteBundled with product analytics.

6.4 · Targeting rules

Definition. A targeting rule maps a request (the evaluation context: user id, attributes, segment) to a variation of a flag. Rules evaluate in order; the first match wins; otherwise the default applies.

Rule shapeExample
User listuserId in ["alice","bob"] → true
Segmentsegment = "Beta-Customers" → true
Attribute matchplan = "enterprise" AND country in ["DE","FR"]
Percentage rollout10% of users (sticky via hash of userId)
PrerequisiteFlag new-checkout only evaluates if flag checkout-rewrite is on
Time windowOn after 2026-06-01 09:00 UTC
# OpenFeature evaluation in Node.js
const client = OpenFeature.getClient();
const ctx = { targetingKey: user.id, plan: user.plan, country: user.geo };
const useNewCheckout = await client.getBooleanValue(
  'new-checkout', false, ctx
);

6.5 · Multi-variate experimentation

Definition. An experiment uses random assignment of users to variants and a statistical procedure to estimate the causal effect of a change on one or more metrics of interest (the primary metric) while monitoring guardrail metrics (revenue, latency, errors).

MethodTrade-offsUsed by
Frequentist fixed-horizon (t-test, χ²)Simple, classic; needs pre-declared sample size; no peeking.Most platforms.
Sequential testing (mSPRT, Always-Valid CIs)Safe to peek; stop early on strong signal; conservative power.Statsig, Optimizely Stats Engine.
BayesianPosterior probability "B beats A"; intuitive; needs priors.VWO, GrowthBook.
CUPED (Controlled-Experiment Using Pre-Experiment Data)Variance reduction using pre-period covariates (Microsoft, 2013); shrinks required sample ~30–50%.Statsig, Meta, Netflix in-house.
Switchback / interleavingFor marketplace or ranking experiments where SUTVA violates.DoorDash, Uber, Lyft.
  • Guardrails are mandatory. Even a conversion-positive variant gets rolled back if p99 latency or error rate breach.
  • Sample ratio mismatch (SRM) — if 50/50 split yields 52/48, the experiment is biased; halt and investigate.
  • Novelty effect & primacy effect — early days of a test over- or under-state impact; require a soak.

6.6 · OpenFeature — the CNCF standard

Definition. OpenFeature is the vendor-neutral specification and SDK set for feature flagging, donated to the CNCF in 2022 and promoted to Incubating in 2023. It defines an Evaluation API, a Provider interface (the adapter to a backend), Hooks (telemetry, validation), and an Evaluation Context.

App codegetBooleanValue() OpenFeature SDKspec API + hooks Provider · LaunchDarkly Provider · Flagd Provider · Statsig Backend
  • flagd — OpenFeature reference daemon; reads flag definitions from files, Kubernetes CRDs, or remote sources.
  • Provider switching is one line. Migrate vendors without touching call sites.
  • Hooks standardise telemetry (OpenTelemetry spans on each evaluation), validation, and logging across vendors.

6.7 · Progressive delivery

Definition. Progressive delivery (term coined by James Governor of RedMonk, 2018) combines feature flags + canary deployments + observability so that releases are gradual, measured, and reversible. The flag controls audience; the deployment controls binary; the metrics control progression.

StepDeploy stateFlag stateSignal watched
MergeImage builtOff everywhereCI green
Deploy to prodPods running v2Off (dark)Startup probes
Internal dogfoodv2 100% in prodOn for staff segmentError logs, perf
1% canary releasev2 100% in prodOn for 1% of usersSLO, conversion
50% → 100%v2 100% in prodRamped via analysisGuardrails, primary metric
Cleanupv2 stableFlag removed in next PRCode refs zero
  • Argo Rollouts + LaunchDarkly integration — AnalysisRun can flip a flag based on Prometheus / Datadog metrics.
  • Flagger + Datadog — Mann-Whitney metric checks tied to flag ramps.
  • Statsig Auto-rollback — pulse-monitors guardrails; auto-disables the experiment on regression.

6.8 · Flag hygiene

Flag debt is the cholesterol of your codebase. Old release flags clutter conditionals, multiply test matrices, and hide dead branches. The 2023 Statsig benchmark found 35% of release flags outlive their useful purpose by a year or more.
  • Every flag has an owner (team + person) and an expiry date stored in the platform.
  • Stale-flag PRs are automated — Flag-Cleaner (Uber, OSS 2023), LaunchDarkly Code References + Stale Flags, Statsig Cleanup Bot.
  • One-way doors get tagged — flags whose removal would be a regression (operational, entitlement) are marked permanent.
  • Tests cover both variants while a release flag is live; remove the off-branch tests when you remove the flag.
  • Naming convention. release.checkout_v3_2026q2 — type, area, intent, era.

6.9 · Architecture — evaluation models

ModelMechanismLatencyTrade-off
Local evaluation (server SDK)SDK downloads the full ruleset; evaluates in-process.µsSlight memory + initial fetch; no per-call network.
Remote evaluationEvery call → HTTPS to the platform; identity stays server-side.5–50 msHigher cost & latency; better for PII-sensitive rules.
Edge evaluationRuleset replicated to CDN edge (Vercel Edge Config, Cloudflare KV).< 1 msEventual consistency on the order of seconds.
Streaming updates (SSE / WebSocket)Push rule changes to SDKs as they happen.Seconds to convergePersistent connection per SDK instance.
Polling updatesSDK fetches the ruleset on an interval (default 30–60 s).Up to intervalSimpler; higher tail latency on flag flips.
Offline cacheLast-known ruleset persisted to disk so cold starts still serve.—Required for safety; never block app startup on the flag service.
Never let your flag platform be a hard dependency. If LaunchDarkly is down, every request should default to the safe variant from local cache — not 500. Test this with a chaos drill.

6.10 · Anti-patterns

Anti-patternSymptomRemedy
Flag debt500 flags, 80% should be deletedOwners + expiry + automated cleanup PRs.
Deeply nested flagsif(a) if(b) if(c) ...Refactor to one variant per surface; prerequisites in the platform, not code.
Flag-as-configCron interval stored in flagUse a config service (AppConfig, Consul). Flags are for behaviour, not tuning.
Flag flips without rollout plan"It worked in staging" → 100% on FridayAlways ramp via percentage rollout + watch dashboard.
Server flags shipped to clientsMobile apps see flags that leak roadmapUse client SDK with server-side variant only; obscure flag names.
No fallback defaultService crashes when platform is unreachableAlways pass a safe default; cache to disk.
One mega-flag controlling 12 featuresCannot roll back one regression without disabling othersOne flag per shippable behaviour.
Cross-references
  • Ch 02 — trunk-based development depends on flags to keep mainline shippable.
  • Ch 05 — canary deploys + flags = progressive delivery.
  • Ch 13 — observability provides the signals that gate flag ramps.
  • Ch 17 — secrets are not flags; do not store them in your flag platform.

6.11 · Self-check

Q1 · Which CNCF specification provides a vendor-neutral SDK and Provider interface for feature flagging?
OCI Distribution
OpenTelemetry
OpenFeature
SMI (Service Mesh Interface)
Q2 · Why is local evaluation (SDK ships the ruleset) usually preferred over remote evaluation for server-side feature flags?
It is the only way to support percentage rollouts.
It avoids a network call per evaluation and degrades gracefully if the platform is unreachable.
Remote evaluation cannot do targeting rules.
Local evaluation is the only option compatible with OpenFeature.
Q3 · What distinguishes a release flag from an operational flag?
Operational flags are visible to end users; release flags are not.
Release flags are temporary — removed after rollout — while operational flags are permanent infrastructure controls.
Release flags require Bayesian statistics; operational flags use frequentist.
They are evaluated by different SDKs.