Ask HN: Do you use feature flags? What's the best tool for the job?
1–10 of 19 posts
Re: Ask HN: Do you use feature flags? What's the best tool for the job?
#2https://wtfisanapi.com/wtf-are-feature-flags-angular-example...
Re: Ask HN: Do you use feature flags? What's the best tool for the job?
#3Re: Ask HN: Do you use feature flags? What's the best tool for the job?
#4If it's a SaaS, how does your app function if the SaaS is unavailable?
Re: Ask HN: Do you use feature flags? What's the best tool for the job?
#5This isn't a huge ordeal to DIY. A database table with some fields (name, on/off, dates) and a module to call that checks the db. A simple UI/API to CRUD those rows. If it's a SaaS, how does your app function if the SaaS is unavailable?
* feature flags were generalised as certain class of functions that made an on/off decision based on certain inputs, and the definition of these functions could be sent from the server to client services that had integrated the feature flag library. Functions could be refined at runtime etc -- generalised notion of toggling a toggle.
* there appeared to be capability for services to maintain local cache of the feature flag / expression rules so it didn't introduce a hard failure point on external service. Functions uses to make toggling decisions could be evaluated with inputs locally.
Take this with several grains of salt, never used it, I might be misremembering and it might not actually work this way
Re: Ask HN: Do you use feature flags? What's the best tool for the job?
#6https://github.com/BulletTrainHQ
We'd love feedback!
Re: Ask HN: Do you use feature flags? What's the best tool for the job?
#7To this I'd say it totally depends on the usecase, I've seen 10s of tech teams build this badly and end up causing more harm than good, some even just static config files that require a build to change which totally defeats the point.
I think looking for an open source tool is great, to this I'd say consider the following :
- Before anything else, you'd definitely want the ability to turn the flags off per environment (dev/prod etc) without having to deploy code.
- Do you want to control who can manage features? Quite often you'd want to enable non-tech people to manage / test features.
- How scalable does it need to be? Some people might want to just not have to worry about serving thousands or millions of flags.
- Do you want to serve flags based on users or maybe even groups of users? I've seen attempts at this but then you start having to worry about setting traits and building some sort of rules engine.
Re: Ask HN: Do you use feature flags? What's the best tool for the job?
#8Re: Ask HN: Do you use feature flags? What's the best tool for the job?
#9Should you use a tool at all? One code file with the flags, and a small piece of router middleware that allows the URL to override the value of flags, and then just if statements. This has served me well on the past 3 frontend projects I have built.
Re: Ask HN: Do you use feature flags? What's the best tool for the job?
#10It's really not complicated.
Some webframeworks require an app restart for config file changes to be detected, or restart the app automatically when it detects changes to the file, so I've seen people use databases. But it tends to be an overcomplication and it's usually turned out to be a bit of a pita. It's only worth it if you're regulalrly turning the feature on and off.
Many languages also support build flags, which strips the extra code out completely, but it's an obscure feature, unless you write libraries, that can confuse other programmers.