Feature flags (also known as feature toggles or feature switches) are a software development technique that turns certain functionality on and off during runtime, 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 feature 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 or release toggles, feature flags are a best practice in DevOps, often occurring within distributed version control systems.
Feature flags allow development teams to test new features in production, while mitigating the risk of a poor release by providing a way to quickly roll back the feature if necessary via a kill switch. Because it is often impossible to completely simulate the production environment in staging, feature toggles allow you to validate the functionality of new feature releases in the real world while minimizing the risk.
Using feature flags, a team can modify a system’s behavior without making disruptive code changes to the live code. Thus, one major benefit of feature flags is their simplicity to deploy in the development process. Feature flags decouple feature lifecycle management from code deployment, freeing up the engineering team to work on other tasks. Enabling features can be as easy as toggling an on/off switch or editing a config file vs doing a length code push. Feature flags also encourage trunk-based development, which helps prevent merge conflicts from divergent code paths.
Another use case for feature toggles is allowing a team to test a new feature on a subgroup of end users to see how it performs before rolling it out to a broader audience. Canary testing helps to limit the risk of launching a feature to your full user base, and allows you to quickly roll back a feature simply by toggling it on or off, rather than having to go through another deploy cycle.
Another major benefit is of feature flags are 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, experience a more streamlined development cycle and do rollbacks of code more easily.
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 to your user base.
Feature flagging enhances CI/CD 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 the production codebase but hidden behind feature flags.
With continuous delivery and feature flag management, a team can launch, control, and measure their features at scale.
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. Leading tech companies such as Google, Facebook, Amazon and Netflix frequently a/b test new features before deploying to their full user base.
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 Full Stack customers can follow in the footsteps of the world’s top software companies (like Amazon, Google and Facebook) to develop their user 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.
Optimizely also offers free feature flags through Optimizely Rollouts, a completely free solution (unlike competitors like LaunchDarkly) for controlled feature releases in your product or app. Rollouts offers a number of SDKs on Github for some of the most popular programming languages and frameworks including Node, Python, Ruby, Go, React, Swift and C#.
Start using the power of feature flags today with Optimizely Rollouts!
Be inspired by 40+ experiment ideas that have generated millions in revenue.
Learn the benefits of experimenting at scale from this original research report from the Harvard Business Review
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.
An error has occurred
You can get the very best of Optimizely without spending a dime.Try it out for 30 days, on us.
Hang tight! We're creating your account and password instructions are headed to your inbox.
Please correct form errors
Get a free account with full access to Optimizely's APIs and SDKs.
Already have an Optimizely account? Sign in here.