Feature flags, do’s & dont’s
Why?
Here are reasons why you need to implement feature flags in your new digital platform. You want:
- Dev squads to push code in production on a regular basis (even in sprint);
- To use A/B testing;
- Devs to push their code in master branches (or really short lived branches) to avoid risky and complex code merge;
- To be able to deliver progressively a new version of some feature or microservice (blue/green deployment or canary release).
Do’s
- See release feature flags as a technical debt;
- Except for ops toggles, all feature flags should be put in the backlog for their eventual removal;
- Decide a flag naming convention. As a result, everyone should be able to identify what type of flag they are dealing with;
- Log every flag value change. In the end, everyone must be able to know who changed a flag and when;
- All your flags should be understandable by the product owner. The product owner should be able to log into a console by himself and see the value of every flag;
- Manage access to feature flags, you don’t want everyone to be able to play with toggles. Potentially, it could really be harmful for your system if access is poorly managed;
- Have a status for your feature flags. Consequently, it will allow you to know witch flags haven’t been used for a while and have expired.
Dont’s
- Put feature flags everywhere;
- Not categorizing feature flags.
- Not being able to find out who changed a feature flag value.
- PO not understanding all feature flags in is system.
Big warning!
Feature flags increase complexity. It’s like adding adding IFs everywhere. The biggest challenge is testing. If you have a lot of feature flags, you might end up with an incredible number of combinations to tests. This is where automated testing is helpful and feature flags must be decided with extreme precaution.
References
It would not be fair to talk about feature flags without mentioning LaunchDarkly. This startup is providing the most complete set of tools, SDKs and libraries (nearly for every language and platform that exist). Also worth to mention, they have SDKs & APIs for mobile and web apps. Yes they are pricey but they will get you going very fast. Recently, they completed another financing round witch leads us to believe they will continue to innovate and improve.
Great article on Martin’s Fowler site : https://martinfowler.com/articles/feature-toggles.html
Complete list of feature flag libraries by programming language: http://featureflags.io/