What is "Feature Toggles" in Release Process ?
Ankit Singhal (MBA, SAFe, CSM, Prince2, Kanban)
Dynamic Technology Leader | Staff Technical Program Manager | Program Director | Technical Product Manager | Chief of Staff | Agile Coach | Digital Transformation Expert | eCommerce, Gaming, Banking, Healthcare
Feature ‘toggles or switches’ enable deployment of features into production without making them visible to the end-user. They help avoid the need for multiple code branches, allowing developers to deploy new features to production but only activate them when the enterprise is ready to consume them. After the feature has been released and deemed stable, the toggles are removed to avoid technical debt.
Main usage of Feature Toggle:
To avoid conflict that can arise when merging changes in software at the last moment before release.
Disadvantage of Feature Toggle:
This can lead to: “Toggle Debtâ€. Toggle debt arises due to the dead code present in software after a feature has been toggled on permanently and produces overhead. This portion of the code has to be removed carefully as to not disturb other parts of the code.
Types of feature toggle:
1. Release Toggle: The developer determines to either keep or remove before a product release depending on its working.
2. Business Toggle: It is kept because it satisfies a different usage compared to that of the older code.
Feature toggles can be used in the following scenarios:
1. Adding a new feature to an application.
2. Enhancing an existing feature in an application.
3. Hiding or disabling a feature.
4. Extending an interface.
Feature toggles can be stored as:
1. Row entries in a database.
2. A property in a configuration file.
Feature toggle components:
- Toggle point: is the component which call the toggle router;
- Toggle router: contains the logic to check if a certain toggle point is active or not. Toggle router reads toggling configurations to detect features or simply detect an Toggle Context. For example a special cookie or HTTP header.
- Toggle configurations: contains the information about the active/deactivate toggle points. Usually, toggle configurations, are environment-specific.
Cheers!