I am new to mongoDB while going through some tutorial I got a question in my mind that, in sharded environment during reading operation "mongos" first checks config server to get details to which shard it has to query. But what about during write operation does it first checks to which shard it has to perform write operation?
Thanks in advance, Kitty
答案 0 :(得分:0)
我将根据MongoDB v3.2的当前稳定版本回答。
config servers将群集的元数据存储在配置数据库中。 mongos实例缓存此数据并使用它将读取和写入分片。
MongoDB仅在元数据更改时将数据写入配置服务器,例如:
在以下情况下,MongoDB从配置服务器读取数据: