TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Principles for building and scaling feature flag systems

212 点作者 ferrantim超过 1 年前

18 条评论

mabbo超过 1 年前
&gt; Make feature flags short-lived. Do not confuse flags with application configuration.<p>This is my current battle.<p>I introduced feature flags to the team as a means to separate deployment from launch of new features. For the sake of getting it working and used, I made the mis-step of backing the flags with config files with the intent to get Launch Darkly or Unleash working ASAP instead to replace them.<p>Then another dev decided that these Feature Flags look like a great way to implement permanent application configs for different subsets of entities in our system. In fact, he evangelized it in his design for a major new project (I was not invited to the review).<p>Now I have to stand back and watch as the feature flags are being used for long-term configurations. I objected when I saw the misuse- in a code review I said &quot;hey that&#x27;s not what these are for&quot;- and was overruled by management. This is the design, there&#x27;s no time to update it, I&#x27;m sure we can fix it later, someday.<p>Lesson learned: make it very hard to misuse meta-features like feature flags, or someone will use them to get their stuff done faster.
评论 #37613456 未加载
评论 #37613622 未加载
评论 #37617260 未加载
评论 #37613473 未加载
评论 #37617197 未加载
评论 #37616434 未加载
评论 #37618287 未加载
评论 #37613176 未加载
评论 #37613198 未加载
评论 #37619620 未加载
评论 #37624181 未加载
dabeeeenster超过 1 年前
For those that dont know about the project, check out Open Feature <a href="https:&#x2F;&#x2F;openfeature.dev&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;openfeature.dev&#x2F;</a> which is sort of like Open Telemetry but for feature flags. Helps avoid vendor lock in. We&#x27;re a young project and looking for help and to build the community!
评论 #37621791 未加载
staplung超过 1 年前
This feels a bit like the dicta on 12 Factor: rules handed down from a presumed authority without any discussion of the tradeoffs. Engineering <i>is</i> tradeoff evaluation. Give me some discussion about the alternatives, when and why they&#x27;re inferior and don&#x27;t pretend like the proposed solution doesn&#x27;t have shortcomings or pitfalls.
评论 #37614184 未加载
tiberriver256超过 1 年前
Item #1 depends on the reason you&#x27;re using feature flags.<p>For a more nuanced and careful discussion of the topic I like to reference: <a href="https:&#x2F;&#x2F;martinfowler.com&#x2F;articles&#x2F;feature-toggles.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;martinfowler.com&#x2F;articles&#x2F;feature-toggles.html</a>
评论 #37613510 未加载
oddx超过 1 年前
I dedicated a day to evaluating feature flag software based on specific criteria:<p><pre><code> - Must support multiple SDKs, including Java and Ruby. - Should be self-hosted with PostgreSQL database support. - Needs to enable remote configuration for arbitrary values (not just feature flags). I don&#x27;t run two separate services for this. - Should offer some UI functionality. - it should cache flag values locally and, ideally, provide live data updates (though pooling is acceptable). </code></pre> Here are the four options that met these basic criteria and underwent detailed evaluation:<p><pre><code> - Unleash: Impressive and powerful, but its UI is more complex than needed, and it lacks remote configuration. - Flagsmith: Offers remote configuration but appears less polished with some features not working smoothly; Java SDK error reporting needs improvement. - Flipt: Simple and elegant, but lacks remote configuration and local caching for Java SDK. - FeatureHub: Offers fewer features than Unleash and Flagsmith; its Java API seems somewhat enterprisly but supports remote configuration and live data updates. </code></pre> Currently, I&#x27;m leaning towards FeatureHub. If remote configuration isn&#x27;t necessary, Unleash offers more features, and if simplicity is key and local caching isn&#x27;t needed, Flipt is an attractive option.
评论 #37659764 未加载
rubicon33超过 1 年前
As an engineer, I am generally against feature flags.<p>They fracture your code base, are sometimes never removed, and add complexity and logic that at best is a boolean check and at worse is something more involved.<p>I&#x27;d love a world where engineers are given time to complete their feature in its entirety, and the feature is released when it is ready.<p>Sadly, we do not live in that world and hence: feature flags.
评论 #37613783 未加载
jt2190超过 1 年前
I just item 1 (“Enable run-time control. Control flags dynamically, not using config files”) and it’s almost exclusively focused on what to do but not on why to do it.<p>It seems to be skipping past the use-cases and assumptions, in particular, describing what a system with feature flags looks and acts like, what the benefits and drawbacks are.
评论 #37612437 未加载
评论 #37613170 未加载
zellyn超过 1 年前
Background: I work at Block&#x2F;Square, on the team that owns (but didn&#x27;t build) our internal Feature Flag system, and also have a lot of experience with using LaunchDarkly.<p>I like the idea of caching locally, although k8s makes that a bit more difficult since containers are typically ephemeral. People <i>will</i> use feature flags for things that they shouldn&#x27;t, so eventually &quot;falling back go default values&quot; will cause production problems. One thing you can do to help with this is run proxies closer to your services. For example, LaunchDarkly has an open source &quot;Relay&quot;.<p>Local evaluation seems to be pretty standard at this point, although I&#x27;d argue that delivering flag definitions is (relatively) easy. One of the real value-add of a product like LaunchDarkly is all the things they can do when your applications send evaluation data upstream: unused flags, only-ever-evaluated-to-the-default flags, only-ever-evaluated-to-one-outcome flags, etc.<p>One best practice that I&#x27;d love to see spread (in our codebases too) is <i>always</i> naming the full feature flag directly in code, as a string (not a constant). I&#x27;d argue the same practice should be taken with metrics names.<p>One of the most useful things to know (but seldom communicated clearly near landing pages) is a basic sketch of the architecture. It&#x27;s necessary to know how things will behave if there is trouble. For instance: our internal system uses ZK to store (protobuf) flag definitions, and applications set watches to be notified of changes. LaunchDarkly clients download all flags[1] in the project on connection, then stream changes.<p>If I were going to build a feature flag system, I would ensure that there is a global, incrementing counter that is updated every time any change is made, and make it a fundamental aspect of the design. That way, clients can cache what they&#x27;ve seen, and easily fetch only necessary updates. You could also imagine annotating that generation ID into W3C Baggage, and passing it through the microservices call graph to ensure evaluation at a consistent point in time (clients would need to cache history for a minute or two, of course).<p>One other dimension in which feature flag services vary is by the complexity of the rules they allow you to evaluate. Our internal system has a mini expression language (probably overkill). LaunchDarkly&#x27;s arguably better system gives you an ordered set of rules within which conditions are ANDed together. Both allow you to pass in arbitrary contexts of key&#x2F;value pairs. Many open source solutions (Unleash, last I checked, some time ago) are more limited: some of them don&#x27;t let you vary on inputs, some only a small set of prescribed attributes.<p>I think the time is ripe for an open standard client API for feature flags. I think standardizing the communication mechanisms would be constricting, but there&#x27;s no reason we couldn&#x27;t create something analogous to (or even part of) the Open Telemetry client SDK for feature flags. If you are seriously interested in collaborating on that, please get in touch. (I&#x27;m &quot;zellyn&quot; just about everywhere)<p>[1] Yes, this causes problems if you have too many flags in one project. They have a pretty nice filtering solution that&#x27;s almost fully ready.<p>[Update: edited to make 70% of it not italics ]
评论 #37612756 未加载
评论 #37613022 未加载
评论 #37612678 未加载
评论 #37612797 未加载
评论 #37613355 未加载
eximius超过 1 年前
The system we&#x27;re building now meets most of these but not necessarily in the way described.<p>First, we&#x27;re building a runtime configuration system on top of AWS AppConfig. YAML&#x2F;proto validation that pushes to AppConfig via gitops and bazel. Configurations are namespaced so the unique names is solved. It&#x27;s all open in git.<p>Feature flags are special cases of runtime configuration.<p>We are distinguishing backend feature flags from experimentation&#x2F;variants for users. We don&#x27;t have (or want) cohorting by user IDs or roles. We have a separate system for that and it does it well.<p>The last two points - distinguishing between experimentation&#x2F;feature variants and feature flags as runtime configuration are somewhat axiomatic differences. Folks might disagree but ultimately we have that separate system that solves that case. They&#x27;re complimentary and share a lot of properties but ultimately it solves a lot of angst if you don&#x27;t force both to be the same tool.
tvink超过 1 年前
&gt;Organizations who adopt feature flags see improvements in all key operational metrics for DevOps: Lead time to changes, mean-time-to-recovery, deployment frequency, and change failure rate.<p>Is this true? unfortunately there&#x27;s no sources indicated, and a quick check on scholar doesn&#x27;t show me anything of the sort.
评论 #37631771 未加载
评论 #37634700 未加载
评论 #37624214 未加载
Lutger超过 1 年前
We use Unleash. There are many things you can do with feature flags and Unleash helps with a lot of them. However, my feeling is 80% of the value comes from 20% of the features. Even a much simpler system provides a ton of benefit. For me, it is top of the list after having automated tests and automated deployments.
aranchelk超过 1 年前
With regard to web-based services, once you’ve got the ability to do canary testing, IMO flags&#x2F;toggles are less compelling — busier code and logic you’ll have to pull out later.
评论 #37616858 未加载
评论 #37613535 未加载
评论 #37617682 未加载
sinuhe69超过 1 年前
I know features flags like the flags of FF, but they are in fact config files. How does one realize dynamic control of features flags?<p>Are they using a kind of logic to determine to turn on&#x2F;off a feature or do they query a central database to know that?<p>Can someone explain its basic mechanism? Thanks
adasdasdas超过 1 年前
More principles<p>- Require in code defaults for fault tolerance<p>- Start annoying the flag author to delete if the flag is over a month old<p>- Partial rollout should be by hash on user id<p>- Contextual flag features should always be supplied by client (e.g. only show in LA, the location should be provided by client)
评论 #37615319 未加载
评论 #37621021 未加载
评论 #37616453 未加载
flitzofolov超过 1 年前
I couldn&#x27;t find an easy link from these docs to the product page on mobile. Seems like a wasted opportunity. I had to edit the URL to get to the company website.
angarg12超过 1 年前
Offtopic but relevant:<p>TL;DR if you break long posts into pages, at least have an option to see the whole thing in a single page.<p>I use a browser extension to send websites to my Kindle. It&#x27;s great for long-ish format blog posts that I want to read, but I don&#x27;t have the time at the moment. However, whenever I see long blog posts that are broken into sections, each one in it&#x27;s own page, it becomes a mess. It forces me to navigate each individual page and send it to my Kindle. Then in the Kindle I have a long list of unsorted files that I need to jump around to read in order.<p>I understand breaking long pieces of text into pages makes it neater and more organized, but at least have an option to see the whole thing in a single page, as a way to export it somewhere else for easy reading.
dgorton超过 1 年前
Open Source knowledge sharing. I like it:<p>&quot;Unleash is open-source, and so are these principles. Have something to contribute? Open a PR or discussion on our Github.&quot;
jacomoRodriguez超过 1 年前
Is it just me or does this articles text structure and wording strongly indicate that is was written by gpt?
评论 #37616279 未加载
评论 #37614435 未加载
评论 #37616744 未加载