A toggle is a switch with two positions: on and off. You see them in everyday technology—in the buttons of your smartphone that enable or disable WiFi and Bluetooth, for example. In software applications, toggles allow users to choose between stream and map views or between different display modes. In the world of software product development, toggles are used to test a new feature before rolling it out to all users, or to act as circuit breakers during times of high latency.
Using toggles to perform A/B tests is a common practice for companies that want to quickly make data-driven decisions about what features to add or remove from their products. The toggle buckets users into two groups: when the toggle is flipped ON, all users are exposed to the new feature that is being tested; when it is flipped OFF, all users see the original version of their application without the new test-focused functionality.
Toggles can also be used to support a wide variety of continuous delivery practices. For example, a dev team may write a new feature on a code branch and then put it behind a feature toggle to allow them to release the branch into production without impacting existing user experiences. This allows the team to validate the new functionality with a subset of their users before it’s ready for full rollout and minimizes the risk that a large change will have a negative impact.
Many teams also use toggles to deploy features in a canary release. By exposing a small cohort of users to the new functionality and monitoring performance with metrics such as churn, uplift and conversion, you can be confident that a larger group of users will find the change valuable before committing to rolling it out to all users.
One of the most important rules for managing feature flags is to keep them as short-lived as possible. Keeping old toggles around in your application creates maintenance overhead that should be avoided whenever possible. The most effective way to do this is to use a feature management platform that provides a centralized place to manage your toggle configuration and a robust admin UI which makes it easy for developers, testers and product managers to view and modify these settings.
It’s also a good idea to name your feature toggles in a meaningful manner that tells someone on the team what it does. For example, “Download Videos” is a better choice than just “Download”. This helps everyone understand what the toggle does and makes it easier for someone to search and identify them. In addition, most teams prefer to keep all toggle configuration in source control so that any toggle can be easily flipped On or Off for testing purposes. This makes it even more important to have a robust process for pruning old toggles once they’ve run their course. This might involve adding a toggle cleanup task to your dev team’s backlog or building that process into the feature management platform.