What are Feature Flags?

Feature flags, also known as feature toggles or release toggles, allow you to enable or disable specific functionality in your software without updating the code itself.

Feature flags are particularly useful if you’re practicing CI/CD with trunk-based development, as they allow you to keep merging to and deploying from master without immediately making new features available to users. Separating deployment from launch also makes it easier to coordinate product and marketing efforts with the availability of a new feature.

You can implement feature flags with a simple configuration file, allowing you to enable a feature in some environments (such as testing) and disable it in others (such as staging and live). Bear in mind that using feature flags extensively adds complexity, and it can involve considerable manual overhead to maintain them.

If you find yourself dealing with more than a handful at a time or want to use feature flags to run A/B tests on users, you may want to consider using a database or dedicated tool to make management easier.