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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Consistent hash ring Python library for building distributed apps with Redis

31 点作者 thomas-st将近 10 年前

3 条评论

jwatte将近 10 年前
The hash ring is so dumb. I don&#x27;t understand why it&#x27;s still a thing (or was a thing to begin with.)<p>Just hash and mask some number of bits, and map each index you get to some node. Faster, simpler, even enough distribution.<p>If your number of nodes is not a power of two, map multiple buckets to each node.<p>When adding nodes, and the # buckets is too low, split each bucket in two by adding one bit to the mask.<p>Consistent table construction means you only need the set of nodes to construct the take, keeping lookups entirely in core.<p>Maybe I should blog this, but it feels a bit like &quot;Hey you cab implement modulo power of two with a bit mask! Isn&#x27;t that so crazy?&quot;
评论 #10064198 未加载
评论 #10064561 未加载
byronhe将近 10 年前
why not use Jump consistent hash?
ameyamk将近 10 年前
This is good - but isn&#x27;t this problem is now solved with redis cluster?
评论 #10063875 未加载