当前位置:网站首页>微信一面:一致性哈希是什么,使用场景,解决了什么问题?
微信一面:一致性哈希是什么,使用场景,解决了什么问题?
2022-07-21 16:06:00 【InfoQ】


如何分配请求?


使用哈希算法有什么问题?
hash(key) % 3



使用一致性哈希算法有什么问题?

- 第一步:对存储节点进行哈希计算,也就是对存储节点做哈希映射,比如根据节点的 IP 地址进行哈希;
- 第二步:当对数据进行存储或访问时,对数据进行哈希映射;


- 首先,对 key 进行哈希计算,确定此 key 在环上的位置;
- 然后,从这个位置沿着顺时针方向走,遇到的第一节点就是存储 key 的节点。



- 对节点 A 加上编号来作为虚拟节点:A-01、A-02、A-03
- 对节点 B 加上编号来作为虚拟节点:B-01、B-02、B-03
- 对节点 C 加上编号来作为虚拟节点:C-01、C-02、C-03

总结
边栏推荐
- Dynamics 365: 如何解除实体只能创建2个Access Team Templates的限制
- Dynamics 365: usage of access team templates
- Dynamics crm: how to create an automatic numbering attribute for an entity
- uniapp开发的微信小程序如何上传至微信小程序平台-完整简单步骤
- Is there any risk in the bank's robust financial products? Will the principal be lost?
- 你离「TDengine 开发者大会」只差一条 SQL 语句!
- Dynamics 365: several plug-ins for creating Er (entity relationship) diagrams in xrmtoolbox are recommended
- kubernetes 静态存储与动态存储
- 浅谈负载
- 抖音web逆向教程
猜你喜欢
Application between azure service bus and dynamics 365 service endpoint
公网官网建站笔记(五):域名工信部备案完整流程并解析公网访问
Dynamics crm: use setfilterxml to filter the records that need to be displayed in the subgrid control of the form
Dynamics crm: precautions for batch importing data to update records
Dynamics 365: explain the execution depth of plug-ins (pluginexecutioncontext.depth)
Notes on the establishment of the official website of the public network (V): the complete process of filing the domain name with the Ministry of industry and information technology and resolving the
Dynamics crm: when removing a control from the form, the prompt "the field you are trying to remove is required by the system or business"“
开发动态 | StoneDB 2022年版本发布里程碑
Dynamics 365: usage of access team templates
Dynamics CRM: 如何通过高级查找来搜索用Connection关联起来的实体记录
随机推荐
Dynamics crm: role of non event dependencies in form
Dynamics CRM: 对于实体Form中的Tab和Section控件的一些说明
Dynamics CRM: 如何为实体创建一个自动编号属性
Dynamics 365: how to remove the restriction that an entity can only create two access team templates
Introduction to single chip microcomputer: light up multiple LED lights
MySQL 分库分表及其平滑扩容方案
Dynamics crm: mailbox configuration (II) - one of the possible reasons why messages cannot be received in dynamics CRM
一线工程师告诉你嵌入式真实现状与发展前景「建议收藏」
Use the C console program to read the messages in the azure service bus queue
华泰证券开户安全么,不知道怎么操作
Dynamics crm: use setfilterxml to filter the records that need to be displayed in the subgrid control of the form
How to write SQL statements?
Introduction to single chip microcomputer: light up the first LED light
G026-DB-GS-INS-03 OpenEuler 部署 OpenGauss(1主2备或多备)
Dynamics crm: deeply analyze the impact of sandbox and asynchronous services on plug-in and workflow in on premise server
Dynamics CRM: 遇到“The plug-in execution failed because no Sandbox Hosts are currently available.“
Dynamics 365: 如何解除实体只能创建2个Access Team Templates的限制
Completion report of communication software development and Application
Dynamics 365: find which records are shared to a user by access team
Dynamics crm: how to search entity records associated with connection through advanced search