Feature Flag Evaluation
Feature flag evaluation is the runtime decision process that determines whether a given user or request should see a new feature, a variant in an A/B test, or the default behavior — based on targeting rules, percentage rollouts, and kill switches stored in a centralized flag configuration service.
Feature flag evaluation is the runtime decision process that determines whether a given user or request should see a new feature, a variant in an A/B test, or the default behavior — based on targeting rules, percentage rollouts, and kill switches stored in a centralized flag configuration service.
What the diagram shows
This flowchart traces the evaluation of a single feature flag for an incoming request:
1. Check kill switch: if the flag has been globally disabled (the "kill switch" is on), the feature is off for everyone regardless of other rules. This enables instant rollback without a deployment. 2. Check allowlist: specific user IDs, account IDs, or internal employees can be explicitly included in the flag's allowlist — useful for internal testing and canary users. 3. Evaluate targeting rules: the flag SDK evaluates configured rules against user attributes (e.g., country == "US", plan == "enterprise"). If a rule matches, the rule's variant is returned. 4. Percentage rollout: if no rule matched, the user's ID is hashed and mapped to a consistent bucket. If the bucket falls within the rollout percentage, the feature is enabled. 5. Return default: users outside the rollout receive the default (off) variant.
Why this matters
Feature flags decouple code deployment from feature release. A team can ship code to production with a flag guarding the new feature, then gradually roll it out — monitoring error rates at each percentage — and instantly kill the flag if something goes wrong. This is the foundation of continuous delivery without big-bang launches.
Flags integrate naturally at the API Gateway Request Flow layer for request-level routing, or inside the application server for fine-grained feature control. The kill-switch behavior mirrors the fail-fast logic of the Circuit Breaker Pattern.