What is a feature flag? A feature flag is the ability to turn features on and off in an application so that product teams can experiment and learn. Product teams can use feature flags to decide whether a feature is available for their users – either all users, a proportion of users or no users. It’s a way of launching a new feature in a controlled way, in order to learn whether it works correctly “in the wild” – i.e. it is valuable and useful for the user base.
What are the benefits?
Feature flags allow for use cases where there is a need to have several different versions of the product live at the same time without impacting each other. They can co-exist peacefully on separate branches or servers, and allow the product team to test out new flows or features before deciding which one is good enough to release globally.
Feature flags are also commonly used by large organisations when rolling out updates or changes of any kind. Instead of releasing code globally at once, these changes are only turned on one user at a time over an unspecified amount of downtime depending on your testing needs. This allows you to gather real world user feedback before you release something globally – its all about reducing risk.
They are particularly useful for product teams who wish to work in a lean way, and use experimentation to discover the risks of launching a new feature or product.
Feature flags have been used for years at companies like Google and Facebook but are only just now starting to come into their own for smaller companies.
Are there any drawbacks?
There is one major drawback when it comes to using feature flags and that’s scaling. Typically, you would create a branch in your code for each flag that you could turn on or off in production from the UI via the command line interface (CLI). Unfortunately, this creates an unlimited number of branches that eventually leads to chaos as any change to the existing functionality might require multiple changes across all these branches.
How do I use feature flags?
Services like LaunchDarkly have started to bring feature flagging into the cloud which makes it easy for startups and small teams to try out their code before deploying it publicly. It also allows them to collect data on certain features that they can then use as a selling point in the future or simply use it as a guide on what new features to build next.