Ship dark, release later
A feature flag is a runtime switch that turns a piece of behavior on or off without a new deploy. The code ships dark, hidden behind the flag, and you flip the flag to release it. This separates deploy from release, two events teams often want to control independently.
What flags enable
- Gradual rollout by enabling the flag for a growing percentage of users.
- Targeting so the flag is on for internal staff or a beta cohort.
- Kill switch to disable a misbehaving feature instantly with no redeploy.
- Experiments by serving variants and comparing outcomes.
The discipline
Flags are evaluated by a flag service that the app checks at runtime. Stale flags pile up as debt, so teams remove flags once a feature is fully launched. A flag that controls dangerous behavior should default to off when the service is unreachable.
Key idea
A feature flag decouples deploy from release so you can roll out, target, or instantly kill a feature without shipping new code.