如何对现有的键值存储进行分片?

发布于 2024-09-18 09:37:28 字数 353 浏览 4 评论 0原文

假设我们在服务器 A 上有 3Gb 键值存储。我开始觉得我们需要另一台服务器(服务器 B)。因此,我必须通过分片(服务器 A、服务器 B)分离服务器 A 的数据,但是...服务器 A 上的所有键当前按原样表示(例如,comment_ids:user_id:10)。

问题#1:散列当前键名称并在分片上分离所有数据的最佳实践是什么?

问题#2:向分片行添加额外服务器的最佳实践是什么?

PS:抱歉我的英语不好,但我希望我的回答对你来说是清楚的。

谢谢。

PS:我已经用redis标签标记了这个问题,但实际上它根本不是关于redis的,而是关于所有键值存储的。

Let's suppose that we have 3Gb key-value storage on server A. I'm starting to feel that we need another server (server B). So, I have to separate server A data over shards (server A, server B), but... All keys on server A currently represented as is (for example, comment_ids:user_id:10).

Question #1: What is the best practice to hash current key names and separate all data over shards?

Question #2: What is the best practice of adding additional servers to shard's row?

PS: Sorry for my English, but I hope that my answer is clear for you.

Thank you.

PS: I've marked this question with redis tag, but really it's not about redis at all, but all key-value storages.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

感情废物 2024-09-25 09:37:28

一致哈希往往是一个不错的选择 http://en.wikipedia.org/wiki/Consistent_hashing

Consistent hashing tends to be a good choice http://en.wikipedia.org/wiki/Consistent_hashing

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文