DEVOPS / A CONCEPT NOTE
Feature Flags
turning features on and off without deploying code
Overview · mechanism
pitfall · examples
01 / THE SHORT VERSION
The idea in a few sentences.
Feature flags (aka feature toggles) are conditionals in your code that enable or disable functionality without a deployment. You wrap a new feature in if (flags.isEnabled('new-checkout')) { ... }. The flag service evaluates at runtime — flip a switch and the feature activates for all users, a beta group, or just internal testers.
02 / FOLLOW THE MECHANISM
How a feature flag evaluates
Developer
merges code with a flag check:
if (flagService.isEnabled('dark-mode'))— the new code is deployed but dormant.Flag service
LaunchDarkly, Split, or a custom API — holds the flag targeting rules in real-time.
Runtime
when
isEnabledis called, the SDK fetches the flag rules (cached locally) and evaluates against user attributes.Operator
flips the flag to 100% on — the feature activates instantly for all users. No deploy, no restart.
04 / COMMAND NOTES
Read the command, then the result.
Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.
evaluate a feature flag via API
curl -s https://launchdarkly.com/sdk/flag/eval/my-flag --header "Authorization: $SDK_KEY"count flag usage in codebase
git grep "featureFlag|isEnabled" -- '*.ts' '*.go' '*.py' | wc -l05 / CHECK YOURSELF
Could you explain Feature Flags to a teammate?
Try it out loud in two sentences: what it is, and the one detail that changes the picture. If you stall, the gap is the part to reread.
Up next in Delivery & operationsIncident Managementthe structured process of detecting, responding to, and learning from outages