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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Designing a distributed circuit breaker in Golang

18 点作者 subomi5 个月前

1 comment

nzach5 个月前
&gt; Our Solution: Use Redis and Postgres Database Polling + leader election using RedLock<p>To me this seems one of the worst architectural choices they could have made. I&#x27;m assuming they had some constraints that were not mentioned in the article to justify this decision. But for a simple distributed circuit breaker this seems far from a reasonable solution.<p>Besides that, there is one implicit assumption that was made that I&#x27;m not sure is true. By having a &#x27;leader&#x27; you are basically saying that your network connections never fail or that they always fail at the same time. Sure, under normal conditions this assumption doesn&#x27;t seem that bad. But as soon as things start to degrade you may have a pretty bad outage in your hands.<p>If I had to implement this feature I would probably use raft[0] to communicate between pods. And would also keep track of 2 values for each host. One is the local failure rate and the second one is the global failure rate. This way I can change my behavior according to current network conditions.<p>[0] - <a href="https:&#x2F;&#x2F;github.com&#x2F;hashicorp&#x2F;raft">https:&#x2F;&#x2F;github.com&#x2F;hashicorp&#x2F;raft</a>