Prompt
feature flags and experiments
Latest observation
Oct 13, 2026
OpenAI APIWeb search: off
Feature flags and experiments are related, but they serve different purposes.
Feature flags
A feature flag is a runtime switch that lets you turn a feature on or off without deploying new code.
Common uses
- Gradual rollout: release to 1%, then 10%, then 100%
- Kill switch: disable a broken feature instantly
- Environment control: enable in staging, disable in production
- User targeting: turn on for specific users, teams, or regions
- Operational control: separate deploy from release
Example
new_checkout = truefor internal usersnew_checkout = falsefor everyone else
Experiments
An experiment is a controlled test used to measure the impact of a change, usually by splitting users into variants.
Common uses
- A/B testing
- Product decisions
- Measuring conversion, retention, engagement
- Comparing multiple options
Example
- Group A sees old checkout
- Group B sees new checkout
- Measure whether new checkout improves purchase completion
Key difference
- Feature flag = control mechanism
- Experiment = measurement mechanism
A feature flag can be used to run an experiment, but not every flag is an experiment.
In practice
Many teams use the same infrastructure for both:
- A flag system decides who sees what
- An experiment framework logs exposure and outcomes
But they have different requirements:
- Feature flags care about safety, targeting, and rollout
- Experiments care about randomization, consistency, and statistical validity
Example architecture
- Flag service evaluates: “Should user 123 see feature X?”
- Experiment service assigns: “User 123 is in control or treatment”
- Analytics records exposure and results
Rule of thumb
- Use a feature flag when you want control
- Use an experiment when you want evidence
If you want, I can also give:
- a comparison table,
- examples in code,
- or guidance on how to design a flag/experiment platform.