Daily Archives: March 21, 2024

Managing Feature Toggles

A toggle is a switch that can be set to either on or off. It is used to enable and disable features in software applications and websites. Toggles are commonly used in Continuous Delivery workflows as a way to test and roll out new features to a subset of users without risking the production environment. They are also frequently used to provide an opportunity for users to try new features without risking their existing data or experience.

Many teams use a feature flag management platform like Kameleon to manage their toggles. These platforms provide a central repository for all feature flag configuration and an admin UI to easily modify that configuration. These tools are ideal for teams that wish to manage their toggles in a more dynamic manner than static files.

The most common use case for a feature toggle is to perform an A/B test on a small cohort of users. Typically the experimental version of the code that is being tested will be pushed to production with a feature flag and then flipped to the live version once the engineering team has verified that the experiment has produced the desired results. This can help teams avoid introducing a potentially flawed feature into production and reduce the chance of unplanned bugs being introduced by the feature.

Another common use case for a feature toggle is a “Champagne Brunch” style release where a new version of the application can be exposed to a pre-selected cohort for testing and feedback. Champagne Brunches are an excellent way to expose new features to premium users without exposing them to the entire user base.

A final use case for a feature toggle is enabling a “circuit breaker” during high user load. For example, if a website or application experiences high latency a circuit breaker can be enabled with a feature toggle to temporarily disable non-essential features until the issue has been resolved. This helps reduce user frustration and improves the overall quality of the product.

When it comes to managing Feature Toggles there are some general best practices that all teams should follow. First and foremost, teams should keep their inventory of toggles to a minimum. It is tempting to use a feature toggle to configure large swaths of an application but doing so increases the complexity of the codebase and increases the likelihood of bugs or regressions being introduced.

Additionally, teams should be proactive in removing idle toggles once they have run their course. This can be done by adding a toggle removal task to the team’s backlog or even building the process into their feature flag management platform to automatically send PRs to remove idle flags once they have served their purpose. Finally, all teams should ensure that their toggles are cognitively accessible. They should not rely solely on colors to convey state and instead use meaningful labels for their states. Otherwise, some users may be unable to tell what state a toggle is currently in – especially those with color blindness or red/green color blindness.