Technology · Releases

How to release a feature behind a flag

A flag lets you deploy code without forcing every user onto the new behavior.

By OdooMatrix Published 1 min read

Part of a complete guide

This task is one section of Eight software practices that keep business apps reliable, with 7 related tasks on one page.

1. Default it off

The new behavior should be invisible until the flag is on. Deploy that and confirm the old path still works.

2. Turn it on for one user or one test

Enable the flag only for the account you will check. Walk the new path once and write down what you saw.

3. Turn it off

Disable the flag without deploying. The old path should return immediately. If you need a deploy to undo it, it is not a flag.

4. Delete the flag later

When the feature is the default for everyone, remove the flag and the old branch. A permanent flag is a second product.

5. Frequently asked questions

Is a flag a substitute for a backup?

No. It only switches behavior. Take a backup when the change writes data you cannot undo.

Can every feature be flagged?

Flag the ones you may need to turn off. A database migration still needs its own plan.

Who may turn the flag on?

Name those people. An unused flag that anyone can flip is an incident.

6. Related articles and next steps

How to judge it

Treat the checks below as the acceptance test for the change. Names of libraries can vary; the behavior to prove does not.

Continue learning

Need this built?

See software development or email OdooMatrix.

← Back to all articles