A replica set tag is member metadata that lets MongoDB match read preferences to attributes such as node type, region, provider, or availability zone. Atlas uses predefined tags to route applications toward suitable members and workload targets. section 10.5 section 10.7
Apply tags by combining them with a read preference:
- Isolate ETL or reporting by using secondary reads with readPreferenceTags=nodeType:ANALYTICS. section 10.5.1
- Keep ordinary secondary reads away from analytics workloads by targeting operational nodes with workloadType:OPERATIONAL. section 10.5.2
- Prefer nearby members by listing geographic tag sets in priority order, then add an empty tag as a fallback. section 10.5.3
- Use readPreference, readPreferenceTags, and readConcernLevel in a connection string; use cursor.readPref() or Mongo.setReadPref() in mongosh. section 10.5
Prefer local GCP regions
Use readPreference=nearest, then try provider:GCP with region:us-east1, provider:GCP with region:us-east4, and finally an empty tag to allow any available member. section 10.5.3
Table 10.5 Predefined replica set tags in Atlas
| Tag name |
Description |
Example |
| Availability Zone |
Identifies the AWS availability zone ID, GCP fully qualified name for a zone, or Azure zone number |
AWS— GCP— Azure— |
| Node Type |
Specifies the type of node. Possible values are |
|
| Provider |
Indicates the cloud provider where the node is provisioned. Possible values are |
|
| Region |
Specifies the cloud region of the node |
|
| Workload Type |
Distributes your workload evenly among nonanalytics (electable or read-only) nodes. Possible value is |
|
| Disk State |
Indicates the state of your disk. Possible value is |
|
Browse Atlas's predefined tag names and values for availability zones, node types, providers, regions, workload types, and disk state. section 10.5
