前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >NoSQL- 分片和复制双剑合璧

NoSQL- 分片和复制双剑合璧

作者头像
ImportSource
发布2018-04-03 16:48:26
8690
发布2018-04-03 16:48:26
举报
文章被收录于专栏:ImportSourceImportSource

翻译内容:

NoSQL Distilled 第四章 Distribution Models

作者简介:

本节摘要:

今天主要说的内容是如何把分片和复制结合起来使用。

4.5. Combining Sharding and Replication 分片和复制双剑合璧

Replication and sharding are strategies that can be combined. If we use both master- slave replication and sharding (see Figure 4.4), this means that we have multiple masters, but each data item only has a single master. Depending on your configuration, you may choose a node to be a master for some data and slaves for others, or you may dedicate nodes for master or slave duties.

复制和分片可以联合起来使用。如果你使用主从复制和分片的方案,这意味着我们有多个master,但是每个数据块都只有一个master。按照你的配置,你可以选一个节点作为一些数据的master,也可以充当其他数据的slave,或者你可以安排一些节点做全职的主节点(master)或从节点(slave)。(译者曰:master和slave可以是兼职也可全职)

Figure 4.4. Using master-slave replication together with sharding

图4.4 把主从复制和分片一块使用

Using peer-to-peer replication and sharding is a common strategy for column- family databases. In a scenario like this you might have tens or hundreds of nodes in a cluster with data sharded over them. A good starting point for peer-to-peer replication is to have a replication factor of 3, so each

shard is present on three nodes. Should a node fail, then the shards on that node will be built on the other nodes (see Figure 4.5).

现在来说说对等复制和分片结合的方案。对等复制和分片合起来用的做法是列族数据库常用的做法。 在这种情况下,你的数据可能分布在成十上百个节点的集群上。一开始你可以用3作为复制因子,什么意思呢?就是把一个分片复制二份分别存到不同的节点上。(译者曰:hdfs默认就是三份)这样的话,如果一个节点出现故障了,那么这个节点上保存的那些分片数据则会由其他节点进行恢复重建(如图 4.5所示)。

Figure 4.5. Using peer-to-peer replication together with sharding

图 4.5 把对等复制和分片一块使用

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2016-04-27,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 ImportSource 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档