基于用户名第一个字符的分片是一致性哈希的示例吗?
基于用户名的第一个字符的分片是一致性哈希的示例吗?
可以肯定的是,如果我根据用户名的字符长度对数据库进行分片,那么从添加或删除一个槽不会改变键到槽的映射的意义上来说,这是否是一致的哈希?
(我知道这绝对不是最有效的数据分片方式,但我感兴趣的是一致性哈希的定义,这种分片方式被认为是一致的吗?)
is sharding based on firstchar of user's name an example of consistent hashing?
To be sure, if i shard my database depending on the char-length of the user's name, is it Consistent hashing in the sense that addition or removal of one slot does not change the mapping of keys to slots?
(I know it is definitely not the most efficient way to shard data, but what i'm interested in is by the definition of consistent hashing, is that way of sharding considered consistent?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它是一致的,但它不是一个哈希
,对实际数据运行测试分片(使用分组依据和计数),你会看到它有多有效,
我的猜测是它会非常不均匀
it's consistent but it is not much of a hash
run a test sharding on actual data (using group by and count) and you will see how effective it is
my guess would be that it would be very uneven