Feature toggles, also known as feature flags, are components of software development that allow specific features of an application to be activated or deactivated at will. This allows developers to safely “toggle” new features on or off for testing. Feature toggles have many uses beyond just testing, such as the targeted release of new features, experimentation, operations, or activation of premium features.
What are Feature Toggles?
A feature toggle is a snippet of code that serves to activate or deactivate a feature in a given code base. This can be done in a number of ways, such as commenting, true/false statements, or even a comprehensive UI. Under a continuous integration (CI) environment that practices continuous delivery (CD) of software releases to its users, all changes to the code are merged into the main trunk on an ongoing basis, often several times per day.
In an organization that practices CI/CD, using feature toggles becomes critical to maintaining the overall stability of the platform, as simply merging untested features without the inherent safety barrier of a toggle would quickly become problematic.
Why Use Feature Toggles?
Toggles have a number of other useful functions beyond just turning features on and off. For instance, if an organization wished to experiment with a new feature not necessarily intended for release, a feature toggle could be used to activate the feature for a select group of users under an A/B testing platform. Often a feature toggle will be folded into what is known as a feature router, which dynamically routes users to different implementations of the code base with the new feature toggled on or off. In this way, targeted groups of internal or external users can be directed to the new feature, in order to collect real-time user metrics for internal review.
Feature toggles can even be implemented on a more permanent basis for operations managers or site administrators. The ability to turn certain features on or off has a wide range of possible applications, including disabling features for site maintenance, or turning off non-critical features when heavy resource load is expected.
Feature toggles are an essential tool in modern software development, where offering ongoing releases and updates is critical to staying competitive. Using feature toggles, organizations can safely and securely test or experiment with new features, release features in a targeted way, or offer users the ability to control which features they use on an individual basis. Start using feature flags for free now.