What is a Toggle?

A toggle is a piece of hardware or software that can be used to switch between two different states. In the case of software it is typically a binary on/off control that either activates or disables functionality. It is a form of control often used in computer systems and programming but can also be found on electronic devices or even hardware like light switches.

Toggle is a word that can seem very simple at first glance but can have a lot of nuance to it. There are many ways to use this word and it is important that we understand the nuances before jumping in and using it ourselves.

In software development, a Toggle is a feature flag that allows us to test new code without impacting production users. It is commonly used for features that will have a significant impact on the user experience and should only be enabled if the product owner has the necessary confidence in the new functionality.

The most common form of a Toggle is a Release Toggle, which is meant to be transitionary in nature and should not remain in place for more than a week or two. It is easy to change the toggling decision for a Release Toggle by rolling out a new release with a toggle configuration change and should be done as soon as possible to avoid losing valuable market data.

More long-lived Feature Toggles are often known as Champagne Brunch or Permissioning Toggles and can have a much longer lifespan – sometimes up to multiple years. Unlike Release Toggles that can be changed by rolling out a new release with corresponding toggle configuration changes these longer-lived Feature Toggles often require a more dynamic toggling decision which is made on a request-by-request basis.

Savvy teams view Feature Toggles as inventory that comes with a carrying cost and seek to keep this inventory as low as possible. As a result, they are proactive about removing unused Feature Toggles and some even create “expiration dates” on their Release Toggles which will cause the system to fail if a release with an expired Feature Toggle is deployed. This is a very effective approach to managing the risk of over-testing and over-provisioning. However, it can still be difficult to manage at a large scale and requires the team to build out some type of administrative UI to facilitate this. More sophisticated solutions are available which provide real-time re-configuration of specific service instances but these tend to have a greater initial overhead and often come with their own set of trade-offs.