What is a feature flag
A feature flag is a technic to enable or disable certain features or code segments in an application at runtime.
This way you control the release of new features, you can experiment with functionality, and manage changes with more flexibly.
Why is it good?
Feature flags can be handy for testing, doing some gradual rollouts, and responding quickly to issues by toggling specific features on or off without redeploying the entire application.
Some less obvious benefits.
- Reduce gap between deployements
By decoupling feature release from code deployment, you can integrate features into the codebase without activating them immediately.
So you can deploy your code to production without releasing the feature themselves.
Minimizing the gap between deployment increase confidence, making deployment less risky because if you keep deploying regularly, the deploy stay small, making easy to know what can be the source of trouble when it arises.
-
Test with specific groups
Feature flags enable testing with specific user subgroups. You can selectively activate a feature for a subset of users while keeping it hidden for others.
This targeted approach is useful for user feedback collection. (Think: QA group, management, power users, etc.)
How to do feature flags
-
Network Based SaaS / OpenSource I won’t provide a review, but this is nice stuff, sometime with a price tag.
- https://launchdarkly.com/
- https://www.flagsmith.com/ (has an open source version)
- https://www.getunleash.io/ (is mostly open source)
- https://www.growthbook.io/ (has an open source version)
- https://openfeature.dev/ (open source)
-
Alternative solutions
-
Just put some Yaml on it Here is an example of how to hack your own feature flag solution with some yaml
-
Language library - an example with go
-
Framework specific, an example with Django
Recently started to use Django-Waffle and it’s pretty nice.
-