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.
精彩评论