Workload Isolation in MongoDB Deployments
Operational Overview
MongoDB includes a number of features that allow databaseadministrators and developers to isolate workload by functional orgeographical groupings.
This capability provides “data center awareness,” which allowsapplications to target MongoDB deployments with consideration of thephysical location of the mongod
instances. MongoDB supportssegmentation of operations across different dimensions, which mayinclude multiple data centers and geographical regions in multi-datacenter deployments, racks, networks, or power circuits in singledata center deployments.
MongoDB also supports workload isolation based onfunctional or operational parameters, to ensure that certainmongod
instances are only used for reporting workloads orthat certain high-frequency portions of a sharded collection onlyexist on specific shards.
Specifically, with MongoDB, you can:
- ensure write operations propagate to specific members of a replicaset, or to specific members of replica sets.
- ensure that specific members of a replica set respond to queries.
- ensure that specific ranges of your shard key balance onto andreside on specific shards.
- combine the above features in a single distributed deployment, on aper-operation (for read and write operations) and collection (forchunk distribution in sharded clusters distribution) basis.
For full documentation of these features, see the followingdocumentation in the MongoDB Manual:
- Read Preferences, which controls how drivershelp applications target read operations to members of a replica set.
- Write Concerns, which controlshow MongoDB ensures that write operations propagate to members of areplica set.
- Replica Set Tags, whichcontrol how applications create and interact with custom groupingsof replica set members to create custom application-specific readpreferences and write concerns.
- Zones in sharded clusters, which allows MongoDBadministrators to create zones that represent a group ofshards and associate one or more ranges of shard key values tothese zones. You can associate each zone with one or more shards in thecluster. A shard can associate with any number of zones. In a balancedcluster, MongoDB directs reads and writes covered by a zone only to theshards inside the zone.
See also
Before adding workload isolation features to your applicationand MongoDB deployment, become familiar with all documentation ofreplication, and sharding.