开发者

In MongoDB autosharding, is the same data available in all the shards?

开发者 https://www.devze.com 2023-02-07 20:53 出处:网络
I am dealing with MongoDB autosharding. Is the same data available in all the shards o开发者_如何学编程r will the data will be different in each shard?Sharding is the practice of splitting your data u

I am dealing with MongoDB autosharding. Is the same data available in all the shards o开发者_如何学编程r will the data will be different in each shard?


Sharding is the practice of splitting your data up among multiple shards, so each shard has a piece of your database. Shard A will not have Shard B's data. If you want data replicated on multiple machines, look at replica sets. Generally, a shard is composed of a replica set of 3 or more machines, so in a setup with 3 shards (each with 1/3 of the database), you would have 9 nodes total, and in any given shard, all 3 nodes in the shard would have an exact copy of all that shard's data.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号