What are Feature Flags?
Feature flags are a software development technique that turns certain functionality on and off, without deploying new code. This allows for better control and more experimentation over the full lifecycle of features.
The idea behind feature flags is to build conditional branches into code in order to make logic available only to certain groups of users at a time. If the flag is “on,” new code is executed, if the flag is “off,” the code is skipped.
Also referred to as feature toggles, feature flags are a best practice in DevOps, often occurring within distributed version control systems.
Benefits of Feature Flags
Feature flags allow features to be constantly deployed but not necessarily "released" into production. Features can be launched with flags set to off or to a select audience to minimize the blast radius of new feature releases in order to validate functionality and performance prior to rolling out broadly.
Using feature flags, a team can modify a system’s behavior without making disruptive changes to the live code. Thus, one major benefit of feature flags is their simplicity to deploy in the development process. Feature flags separate feature lifecycle management from code deployment, freeing up the engineering team to work on other tasks.
Feature flags allow a team to test a new feature on a subgroup of users in a fast and efficient manner, with little risk. Thus, another major benefit is their ability to allow quick learning.
Feature flagging allows companies to continuously deliver and deploy software to their users in a faster way. The use of feature flags allows companies to perform gradual feature rollouts, fix bugs in the code without redeploying, and experience a more streamlined development cycle.
Feature Flags & Continuous Delivery
While they can be cumbersome to manage, developers can build their own systems internally or rely on open source libraries to create feature flagging solutions.
Championed by influential software developer Martin Fowler, continuous delivery is a software development discipline in which software can be released to production at any time. It has been adopted by leading software companies around the world whose teams are now expected to quickly deliver software that is stable and bug-free.
Feature flagging enhances continuous delivery and continuous integration by making “continuous” more achievable. The feature flags and feature toggles are a key component of the implementation of continuous delivery, allowing the separation of feature rollout from code deployment. Incomplete features can be merged into production code but hidden behind feature flags.
With continuous delivery and feature flag management, a team can launch, control, and measure their features at scale.
Feature Flags & A/B Testing
In A/B testing, a team can measure the effectiveness of a feature through tracking various goals, such as clicks, downloads or form completions. They run experiments where two or more variants of a page are shown to users at random, and statistical analysis is used to determine which variation performs best.
With one variation including a feature flag marked “on,” and another with the feature flag marked “off,” a team can measure various performance metrics of each and compare.
Feature flags allow marketers and other non-engineers to A/B test various features within products or systems. With no need for a code deployment, business and non-technical teams can hypothesize, observe and track feature performance and analytics.
Feature Flags in Optimizely
Product and engineering teams can now use Optimizely Full Stack’s feature management to implement feature flags. This allows the same flexibility that product teams have relied on with their experimentation programs to validate hypotheses before launching new products, features, and experiences to everyone.
Now this experimentation can work seamlessly with the practices of continuous integration and continuous delivery employed by today’s advanced engineering teams. Both teams – and entire companies – will be able to benefit from the faster development cycles, and feature management practices like flags or toggles to mitigate risk.
Optimizely’s Full Stack customers can follow in the footsteps of the world’s top software companies (like Amazon, Google and Facebook) to develop their digital experiences, A/B testing to find the best experience possible, then using feature flags to control the rollout.
By first running A/B tests to a small segment of traffic, any team can determine the best version of a new feature, or measure whether the new feature is truly an improvement. Once a feature has been tested and optimized, it can be rolled out in a controlled way across an entire customer base.
The Big Book of Experimentation
Discover 35+ winning experiment ideas that are generating millions in revenue.
Driving Innovation at HP
Learn how HP achieved $21m incremental revenue through experimentation
Experimentation Maturity Model
This assessment is the starting point to understanding your organization’s capabilities and will set you on the path to building a high-performing program.