In 30 seconds
- Ship code switched off, turn it on when ready.
- Enable gradual rollouts, experiments and quick rollback.
- Old flags become debt; remove them once done.
Types of flags
| Type | Use | Lifespan |
|---|---|---|
| Release | Hide unfinished features | Short |
| Experiment | A/B tests | Short |
| Ops | Kill switch for risky features | Medium to long |
| Permission | Features for certain users | Long |
This categorization is from Pete Hodgson's widely cited article on feature toggles.
What flags enable
- Trunk-based development with unfinished work
- Release on demand
- Gradual rollouts and instant rollback
Avoiding flag debt
- Give every flag an owner and expiry date
- Remove release flags soon after full rollout
- Keep a list of active flags
Myth vs reality
Myth · Flags are free.
Reality · Each one adds a code path to test and maintain.
Myth · Flags replace testing.
Reality · Both flag states need testing.
Myth · Flags are only for big companies.
Reality · A simple config switch is a flag.
FAQ
Should we build or buy a flag system?
Start simple; buy when you need targeting and analytics.
How many flags is too many?
When nobody knows what they all do.
What's a kill switch?
An ops flag that turns off a feature instantly if it misbehaves.