
#KILL SWITCH CODE#
The more extra code you add to your codebase, the more complex it gets, and the harder it gets to reason about that code. If not, you will likely be overwhelmed with the sheer volume of flags and unable to maintain them properly. To maintain a codebase with feature flags, you must continually be aware of the different flags’ states. The Cost of a Kill SwitchĪny additional implementation to your codebase comes with a cost. In effect, you’re isolating the change while your codebase evolves around it. This also allows development on other features to continue without forcing a complete rollback. In this way, you avoid rolling back an entire version of your application because you isolate the change to a specific feature. However, in a few weeks, if something goes wrong and there is a bug with the new feature, what do you do? Once the team deploys the code to production, and the product owner turns the flag on, then based on your configuration, the entire user base, or a subset of the user base will be able to see and interact with the new feature.
#KILL SWITCH SOFTWARE#
Let’s take an example of a typical agile team using feature flags in their software development lifecycle. All you’ll need to do is log in to the feature flagging framework and click on the kill switch for that feature. If there is an issue with your code, you won’t have to go through an entire code review process or revert the change that caused the problem.


Not only is this great to promote a good engineering culture, but it also allows anyone on the team to control the state of a feature, regardless of if they code. Having a kill switch allows you to quickly disable the feature, then work on a fix at your leisure, and push it when ready, rather than working under pressure to fix a production issue. This is ideal, especially when you get paged in the middle of the night and find yourself less than eager to take on a code fix. With a kill switch, when a feature breaks in production, you can turn it off immediately while your team analyzes the issue. Incident Management Made Easy with a Kill Switch
#KILL SWITCH HOW TO#
Before feature flags, if something were wrong, developers would have to look through the logs, pinpoint the issue, analyze how to fix it, write the code fix, test it, and then push it live to production, all while the feature is broken in prod. This enables stakeholders to turn off broken features in production simply and immediately, which is often accomplished via a feature flag. In software development, a kill switch is a button that disables a feature if needed.
