知识卡片

普通读书笔记卡 · 2313.e.5.p.3.a.3

一致哈希减少扩容扰动

理解等级:高级

简单hash(key)%N在N改变后会使大量键换分片,缓存相当于局部甚至大范围冷启动。一致哈希将新增或移除节点影响限制在部分键上,改善扩容时迁移范围。均匀布局假设下从10到11片约迁移1/11,但不是每次精确比例保证;实际受节点权重、虚拟节点与键分布影响。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Chapter 7. Sharded Services · 查看原书依据

      changing the scaling function from hash(Req) % 10 to hash(Req) % 11. When you deploy this new scaling function, a large number of requests are going to be mapped to a different shard than the one they were previously mapped to. In a sharded cache, this is

    参考来源

    - 位置:《Designing Distributed Systems, 2nd Edition》第07章《Chapter 7. Sharded Services》(来源项目 book-sources;源文件:extracted/Designing Distributed Systems, 2nd Edition/_epub-src/OEBPS/ch07.html) - 结论依据:原文先说明取模扩容的大范围重映射,再引入consistent hashing;对其比例保证作条件化表达。 - 原始内容:changing the scaling function from hash(Req) % 10 to hash(Req) % 11. When you deploy this new scaling function, a large number of requests are going to be mapped to a different shard than the one they were previously mapped to. In a sharded cache, this is