How to Manage Longevity of a Toggle

March 11, 2024 by No Comments

A toggle is a control that switches between two different states or options. It can be a physical switch found on electronic devices or computer systems or it can be a software setting or feature flag. When designing toggles, it is important to understand the problem statement and identify the target users. Also, it is important to design for clarity and consistency of the toggles state and value. Finally, it is important to consider the impact of the toggle on performance and usability.

Toggle Configuration

Once a toggle is deployed it will stay in the code base until the feature is either stabilized or retired. In order to manage the long-lived lifecycle of a toggle it is often recommended that it be stored in some type of centralized location which can then be managed and manipulated from the existing application DB or an external configuration management system.

Some teams have started to move the toggle configuration out of the code base into a separate file in order to better manage its longevity. While this can make sense for certain types of toggles (such as Ops Toggles) it is not a viable solution for more dynamic toggles such as Champagne Brunch or Experiment Toggles.

Toggle configuration stored in static files is difficult to manage once you get beyond a certain scale. Modifying the configuration in the file can be tedious and difficult to test. In addition it can be difficult to implement an atomic change in a large production environment without having to deploy the entire system and potentially wait for any toggles that have been flipped off to re-configure. This can severely impact the velocity of a team’s validation process and can negatively impact the all-important feedback loop that CI/CD provides.