Sharding Server Types

Three types of MongoDB servers are involved in sharding data. Each of these servers plays a specific role in presenting a single unified view to the applications. The following are the server types, and Figure 17.4 illustrates the interaction between them:

Image Shard: A shard stores the documents that make up the collection. A shard can be an individual server, but to provide high availability and data consistency in production, you should consider using a replica set that provides primary and secondary copies of the shard.

Image Query router: A query router runs an instance of mongos. The query routers provide the interface for client applications to interact with the collection and obfuscate the fact that the data is in fact sharded. The query router processes a request, sends targeted operations to the shards, and then combines the shard responses into a single response to the client. A sharded cluster can contain more than one query router, which is a great way to load balance large numbers of client requests.

Image Config server: Config servers store the metadata about the sharded cluster that contains a mapping of the cluster’s data set to the shards. The query router uses this metadata when targeting operations to specific shards. A production sharded cluster should have exactly three config servers.

Image

Figure 17.4 The query router servers accept requests from the MongoDB clients and then communicate with the individual shard servers to read or write data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.112.79