All terms

Glossary

Feature flag

Also: Feature toggle

A switch in the code that turns functionality on and off at runtime, without shipping a new release.

Feature flags decouple two things that usually coincide: shipping code and releasing a feature. Unfinished code can travel to production safely, and a new feature can be opened to individual customers first.

For migrations they are the tool of choice: the new path first serves one percent of traffic, then ten, and if in doubt you close it again in seconds.

How you notice it

  • Deployment and release should be separated.
  • A change needs to go live for a subset of users.
  • A rollback must not require a new deployment.

Frequently asked

How do we avoid flags piling up?

Give every flag an owner and a removal date when it is created. Flags outlive their purpose by default, and a codebase with forty stale flags has more untested combinations than tests. Removing them is part of finishing the feature.