Hacker News new | ask | show | jobs
by yoz 2115 days ago
Hi - Dev Advocate for LaunchDarkly here.

There's the local cache feature mentioned by shoo below, but more simply, there's also a fallback in the flag eval function, which looks like:

    flag_value = LDClient.variation("flag-identifier", context_object, fallback_value)
... where fallback_value is the value to be returned if there's nothing else available.

As for DIY-ing it, I wrote about the pros and cons of rolling your own here: https://launchdarkly.com/blog/feature-management-platform-bu...

(TL;DR: Sure, you could build your own super simple one in a few hours, but it wouldn't have most of the features that make feature flags useful, and why bother when there are open source implementations already?)

1 comments

I've built one in a few minutes, not hours. Our main requirement was releasing tested code to production ahead of when other interacting pieces are ready (other API's, UI changes, etc.) Usually there is an API contract in place with the other party at this point and feature flags help a CI/CD process keep things moving instead of sitting on a feature.

In Rails if you have Active Admin, you just define the migration for feature flags and you are basically done. AA gives you a UI which you can protect with roles. Put a couple methods on the model and then you can toggle features anywhere in your code.

Our use case is very small, feature flags get deleted after all the moving parts are shipped and working. I'm sure your product has many more use cases and capabilities.