Different Types of Feature Toggles and How they can Benefit your Application Team and Users
Feature toggles can provide benefits to your agile team and your users during development and while your code is in production. There are a number of types of feature toggles, but I’m going to touch on four very useful ones that our teams use to solve specific problems they encounter during the application lifecycle.
This type of toggle is probably more common in the commercial sector, but it also holds true in the federal space as well. There are times where production is the best place to test and experiment with new features or concepts. Maybe you’re experimenting with a new type of workflow, such as a new user interface component or a new way of reporting data, and you want to have your actual production users provide feedback or analyze their behavior using the feature. The experiment toggle allows you to perform A/B testing sending different users down different paths so you can figure out which feature—A or B—works best for your users.
Sometimes individuals on a team are working on a feature that may take many sprints to complete; and we want to keep them working in the same code branch as the rest of the team to make sure they can develop and test their feature with the work of the rest of the team. In this case, a release toggle can be beneficial for a team using CI/CD to allow a feature team to work in the same integration code branch used by the rest of the team. A release toggle enables the developers to quarantine off their unfinished feature from the rest of the code base and turn on and off the feature in local development environments for testing.
There are a number of reasons a team my want to use an operational or ops toggle to turn on or off a feature in a production environment. One use of the ops toggle is on a feature that may have an unknown performance impact in your production environment. If the new feature is noted to degrade system performance, you could quickly turn it off to prevent greater system failures. You could also use the ops toggle to turn off certain portions of your application should they not scale well under heavy load. An example of this is perhaps showing cached or static content on a dashboard during heavy usage periods instead of performing time intensive operations to pull real-time results. The ops toggle is another version of the Circuit Breaker pattern popularized in Michael Nygard’s Release It!: Design and Deploy Production-Ready Software (Pragmatic Programmers).
A sub-category of an ops toggle is the integration toggle, which can enable your team to turn on an updated interface to a third-party system. The team could develop and deploy the newly defined interface or payload to production and wait for the completion of the third-party endpoint to flip the ops toggle. This can prevent the need to synchronize deployments in complex operational environments particularly where cross-agency collaboration in federal government can be challenging.
Tips for using Feature Toggles
Before you implement any of these toggles make sure your team spends the time to correctly identify the appropriate toggle point. The more complexity you allow to creep into what specifically you’re toggling, the greater the risk associated with the toggle. Avoid nesting toggles or toggling across multiple tiers of your application. Instead, focus on protecting the entry point to the feature to minimize complexity and enhance testability. Used correctly, feature toggles can provide benefits to your team during development and while supporting applications in production.