CHAPTER 5: DESIGN CONSISTENT HASHING

这篇具有很好参考价值的文章主要介绍了CHAPTER 5: DESIGN CONSISTENT HASHING。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

The rehashing problem

serverIndex = hash(key) % N
CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构
However, problems arise when new servers are added, or existing servers are
removed.
CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构
CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构
This means that when server 1 goes offline, most cache clients will
connect to the wrong servers to fetch data. This causes a storm of cache misses.

Consistent hashing

Quoted from Wikipedia: "Consistent hashing is a special kind of hashing such that when a hash table is re-sized and consistent hashing is used, only k/n keys need to be remapped on average, where k is the number of keys, and n is the number of slots. In contrast, in most traditional hash tables, a change in the number of array slots causes nearly all keys to be remapped [1]”.

Hash space and hash ring

CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构

Hash servers

CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构

Hash keys

CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构
CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构

Add a server

CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构
Remove a server
CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构

Two issues in the basic approach

• Map servers and keys on to the ring using a uniformly distributed hash function.
• To find out which server a key is mapped to, go clockwise from the key position until the first server on the ring is found.

First, it is impossible to keep the same size
of partitions on the ring for all servers considering a server can be added or removed
CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构
Second, it is possible to have a non-uniform key distribution on the ring. For instance, if servers are mapped to positions listed in Figure 5-11, most of the keys are stored on server 2. However, server 1 and server 3 have no data.
CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构

Virtual nodes

CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构
As the number of virtual nodes increases, the distribution of keys becomes more balanced.

However, more spaces are needed to store data about virtual nodes.
This is a tradeoff, and we can tune the number of virtual nodes to fit our system requirements.

Find affected keys

CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构
located between s3 and s4 need to be redistributed to s4.

CHAPTER 5: DESIGN CONSISTENT HASHING,System Design,系统架构

keys located between s0 and s1 must be redistributed to s2.

The benefits of consistent hashing include:
• Minimized keys are redistributed when servers are added or removed.
• It is easy to scale horizontally because data are more evenly distributed.
• Mitigate hotspot key problem. Excessive access to a specific shard could cause server
overload. Imagine data for Katy Perry, Justin Bieber, and Lady Gaga all end up on the
same shard. Consistent hashing helps to mitigate the problem by distributing the data more
evenly.文章来源地址https://www.toymoban.com/news/detail-733275.html

到了这里,关于CHAPTER 5: DESIGN CONSISTENT HASHING的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【论文阅读】The Design of a Practical System for Fault-Tolerant Virtual Machines

    为了更有效的做论文阅读笔记,之后都打算将每篇论文笔记的内容控制在较少的字数范围内,毕竟原论文摆在那里,将其翻译照抄过来也没什么意思,将论文读薄才是最重要的。( •̀ ω •́ )✧ \\\"The Design of a Practical System for Fault-Tolerant Virtual Machines\\\"是MIT6.824推荐阅读的论文之一

    2024年02月03日
    浏览(49)
  • 论文解读--Wideband 120 GHz to 140 GHz MIMO Radar:System Design and Imaging Results

            本文提出了一种工作频率在120 GHz ~ 140 GHz之间的宽带FMCW MIMO雷达传感器。该传感器基于SiGe技术制造的雷达芯片组,并使用MIMO方法来提高角度分辨率。MIMO操作通 过发射机的时域复用实现 。该雷达能够通过使用FFT处理和延迟和波束形成器产生2D图像。本文给出了雷达

    2024年01月25日
    浏览(36)
  • 小白Cadence学习笔记<2> (Allegro & Design entry CIS & Pad_design)

    上一节分享了学习Cadence的文件夹设置以及简单的元器件绘制,今天继续分享下常见元器件的绘制以及简单原理图的设计。 在分享干货之前关于原理图先说点别的 ,画原理图的本质就是连接器件,每个元器件或多或少都有若干个引脚,所以想要没有大错误就是要保证我们的每

    2024年02月09日
    浏览(47)
  • 小白Cadence学习笔记<3> (Allegro & Design entry CIS & Pad_design)

    上一节分享了在使用 Design entry CIS过程中怎么由一个元器件一步步画出整个原理图。画好原理图之后我们就要开始导出网表了,目的是给我们画PCB的软件Allegro输出网表文件,这个过程可以比喻一下,画好的原理图相当于你做菜时脑海里构思的菜谱,我们现在要把需要的食材(

    2024年02月07日
    浏览(47)
  • 小白Cadence学习笔记<5> (Allegro & Design entry CIS & Pad_design)

    PCB的层次结构 上一篇讲了画一个简单的芯片的QFN24封装的引脚放置问题,这一篇我先分享一下PCB的层次结构,这也是初学者画PCB时比较头疼的抽象问题,我们先从比较简单的双层板开始,我们虽简单的板子就是双层板,想一个三明治一样,先是中间厚厚的材料是环氧树脂,常

    2024年02月05日
    浏览(43)
  • vue3+ant design vue+ts实战【ant-design-vue组件库引入】

    🔥🔥更多内容见Ant Design Vue官方文档 🔥点击复习vue3【watch检测/监听】相关内容 👏👏👏一个好项目的编写不仅需要完美的逻辑,以及相应的技术,同时也需要一个 设计规范的高质量UI组件库 。👏👏👏本期文章将会详细讲解 Ant Design of Vue 组件库的 安装、使用、引入 。

    2024年02月02日
    浏览(47)
  • Ant Design入门

    目录 一:什么是Ant Design? 二:开始使用 三:布局 四:表格         Ant Design 是阿里蚂蚁金服团队基于 React 开发的 ui 组件,主要用于中后台系统的使用。         官网: https://ant.design/index-cn   设计语言: 随着商业化的趋势,越来越多的企业级产品对更好的用户体验有了

    2024年02月02日
    浏览(48)
  • Vue3的几款UI组件库:Naive UI、Element Plus、 Ant Design Vue、Arco Design

    vue3系列的三款ui框架简要对比: 框架 Element Plus Naive ui Ant Design Vue Arco Design 简介 element-ui Vue3版本,国内使用广泛 Vue作者推荐的Vue3ui 组件库 Ant Design 的 Vue 实现,组件的风格与 Ant Design 保持同步 ArcoDesign 主要服务于字节跳动旗下中后台产品的体验设计和技术实现 社区活跃度

    2024年02月03日
    浏览(45)
  • Design Pattern——Heuristic Benchmark

    Purpose: Establishes a clear and understandable baseline for model performance. Helps gauge the value and complexity of an ML model against a simpler, more intuitive approach. Facilitates communication and understanding of model performance to stakeholders who may not have deep ML expertise. Key Steps: Define a simple, interpretable heuristic: Choose a rule

    2024年01月16日
    浏览(43)
  • 苹果上架Guideline 4.3 - Design

    记录一下苹果提审-驳回-再驳回-无数次驳回-反馈-驳回-最后通过,实在太难了! 先看效果 首次提审:2023年9月7日 最终通过:2023年10月11日 被驳回次数:20+ 把处理的过程记录,如下 第一次上架苹果商店,审核提示 百度翻译 1、参考文章1 苹果App store4.3被拒问题;教你如何解决

    2024年02月09日
    浏览(42)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包