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. The foundational material can be found on Martin Fowler’s blog and more resources here.
- A Toggling Tale
- Categories of toggles
- Implementation Techniques
- Toggle Configuration
- Working with feature-toggled systems
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:
- Google’s Scaled Trunk Based Development – DZone Performance
- Trunk Based Development Discussion
- Feature Branches with Bamboo
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– LaunchDarklyAn 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.
iOS SDK GitHub
LaunchDarkly How it Works - GroundControl for iOS– Matt 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, impromptuA/B tests, or a simple“message of the day”..”
GitHub Repo - Android Flagger– Massimiliano Marcon “Flaggr is a library that can be used in Android applications when there is the need forfeature 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.”
GitHub Repo
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:
- 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
- Quickly turn off a poorly performing feature
- Allow users to opt-in for early access to new features
- Do phased rollouts to percentages of your users to verify there are no scalability issues.
- Protect features from users by excluding them from ever seeing them – for example, excluding anyone from TechCrunch from seeing new functionality
- Run a/b tests of features to see which perform better Running an A/B test · LaunchDarkly
- Control subscription plans by bundling features flags into plans
- Show expert users and beginner users different features entirely
- Put portions (or your entire application) into maintenance mode @How LaunchDarkly uses feature-flags for rolling maintenance modes
- Cleanly sunset old, unused features
Resources for Feature Toggles
- Martin Fowler – Feature Toggles
- Wikipedia – Feature Toggle Overview
- Beautiful Builds – Feature Toggle Frameworks List
- Jim Bird – Feature Toggles Are One of the Worst Kinds of Technical Debt
- Feature Toggle Overview – Feature Toggles (Feature Switches or Feature Flags) vs Feature Branches
- Abhishek Tiwari – Decoupling Deployment and Release- Feature Toggles
- Slideshare Presentation on Feature Toggles
- O’Reilly – Chapter 9. Feature Toggle
- Fernando Rubbo – Feature Toggles: Good or Bad
- Tout – Feature Toggles at Tout