Feature Toggles

Feature Toggles

Feature toggles are basically ways to control the full lifecycle of your features.  They allow you to manage components and compartmentalize risk.  You can do pretty cool things like roll out features to certain users, exclude groups from seeing a feature, A/B test, and much more.  Check out this video on canary launching to see the benefits of dark launching features.  The foundational material can be found on Martin Fowler’s blog and more resources here.

Feature Toggles

Feature Toggles & Trunk Based Development is a version control strategy in which developers commit their changes to the shared trunk of a source code repository with minimal branching. Also see this Thoughtworks article on trunk based development.
It is part of the continuous delivery movement that many businesses are switching to. Here a great article by Atlassian on the Business Case for Continuous Delivery. “That’s why software development is moving towards continuity. The recent emphasis on continuous integration, built-in testing, constant monitoring, and analytics feedback all point toward an overall trend in the software industry: increasing the ability to react. As organizations explore what these changes mean for them, they invariably discover continuous delivery, commonly known as CD.”
More Continuous Delivery Resources:
Getting Started:
Software Tools for Implementing Trunk Based Development
  • GitHub
    • Version control and branching
  • BitBucket
    • Version control and branching
  • LaunchDarkly
    • Feature flag management / production testing
  • CircleCI
    • Automated build and deploy to production
For mobile app toggles, here are some resources:
  • LaunchDarkly Mobile iOS Feature Flag SDK – LaunchDarkly An installable feature flag software development kit for iOS apps. This SDK harnesses the LaunchDarkly app and allows you to target users and manage rollouts. Feature flags are evaluated in microseconds.
  • GroundControl for iOS – Mattt Thompson “Many developers don’t realize that they are allowed to remotely control the behavior of their app (provided that the application isn’t downloading any new code). GroundControl gives you a dead-simple way to remotely configure your app, allowing you to add things like feature flags, impromptu A/B tests, or a simple “message of the day”..”
  • Android Flagger – Massimiliano Marcon “Flaggr is a library that can be used in Android applications when there is the need for feature flags. Flaggr helps toggling feature flags at runtime. Once the library is complete it will also be possible to toggle flags directly from the backend, via GCM or by polling your flags API when the application starts.”

According do Edith Harbaugh of LaunchDarkly, Feature toggles are a software development best practice of gating functionality. Functionality can deployed “off”, then turned on via the feature flag, separate from deployment. More sophisticated conditions can be passed along with the feature flag, allowing rollouts to very targeted segments, such as “10% of users”, or “only people in China” or “no one at TechCrunch”, down to the specific user level. Feature toggles are important to separate code deployment from code rollout. Once feature toggles are in place, it’s possible to have fine grained control of your application. With feature toggles you can manage the entire lifecycle of a feature:

  1. Run beta programs on your live application by explicitly including the people you want to see a new feature @Canary launches – how and why to canary release
  2. Quickly turn off a poorly performing feature
  3. Allow users to opt-in for early access to new features
  4. Do phased rollouts to percentages of your users to verify there are no scalability issues Measuring the Performance of New App Features with LaunchDarkly
  5. Protect features from users by excluding them from ever seeing them – for example, excluding anyone from TechCrunch from seeing new functionality
  6. Run a/b tests of features to see which perform better Running an A/B test · LaunchDarkly
  7. Control subscription plans by bundling features flags into plans
  8. Show expert users and beginner users different features entirely
  9. Put portions (or your entire application) into maintenance mode @How LaunchDarkly uses feature-flags for rolling maintenance modes
  10. Cleanly sunset old, unused features

 

Resources for Feature Toggles

 

Feature Toggles in .Net:

Feature Toggles in Groovy

Feature toggles in Ruby

Feature toggles in PHP

Feature toggles in Python

Feature Toggles in JavaScript:

Feature Toggles in Java