We have an application available on more platforms (iOS, Android and multiple backend micro-services: nodeJS, Python). When we develop a new feature and when it’s ready we would like to make it available at the same time on all platforms. And if something’s wrong we’d like to turn it off.
For example:
var featureEnabled = featureService.isMyNewFeatureEnabled();
if (featureEnabled === true) {
// turn on my new feature
}
else {
// use my legacy feature
}
What is the best way to do that?
3 Answers
Right now we have our own solution implemented. Which I regret very much. At first it seemed like a simple task by having downloadable config JSONs on a server containing the feature flag values. And a minimalistic admin page to edit them. Compexity raised when we wanted to add exceptions. Like serving a value for one user group and another value for another segment. So called A/B testing. After trying to hack this feature in our current solution we managed to convince management and got a proper feature flag service.
These are the ones we evaluated:
- Configcat (the one best fit our subjective needs)
- Launchdarkly
- Split
- Rollout
As mentioned in the comments to the question, what you are looking for is "Feature flag management" aka "Feature toggle management", the terms are mixed but are the same. Feature flags do enable different patterns or activation strategies. Examples are among them you describe;
- "Kill switches", e.g. an easy way to disable a feature in production in case there are an issue
- "Release toggle", e.g. enable the feature after the code is deployed into production
Most Feature flag management systems will support the above and more activation strategies.
It is quite common to start by building such tools internally, essentially it is simple: Only a simple flag and a handful of if-statements. Your challenge is once you get dependent on your feature flag management. Usually you would need audit log capabilities, proper user management handling, proper scaling, ensure limited performance impact and similar capabilities. A nice introduction to feature toggle best practices to consider is found in this blog post.
There are multiple strong offerings available, these are the top four: