tencent cloud

TencentDB for MongoDB

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Strengths
Use Cases
Cluster Architecture
Product Specifications
Features
Regions and AZs
Terms
Service Regions and Service Providers
Purchase Guide
Billing Overview
MongoDB Pricing
Billing Formula
Payment Overdue
Backup Space Billing
Configuration Adjustment Billing
Getting Started
Quickly Creating an Instance
Connecting to a TencentDB for MongoDB Instance
Reading/Writing Database
Operation Guide
Access Management
Instance Management
Node Management
Version Upgrade
Network Configuration
Monitoring
Backup and Rollback
Database Audit
Data Security
SSL Authentication
Log Management
Database Management
Multi-AZ Deployment
Disaster Recovery/Read-Only Instances
Parameter Configuration
Recycle Bin
Task Management
Performance Optimization
Data Migration Guide
Practical Tutorial
Optimizing Indexes to Break Through Read/Write Performance Bottlenecks
Troubleshooting Mongos Load Imbalance in Sharded Cluster
Considerations for Using Shard Clusters
Sample of Reading and Writing Data in MongoDB Instance
Methods for Importing and Exporting Data Based on CVM Connected with MongoDB
What to Do for Errors of Repeated Instance Creation and Deletion of Databases with the Same Names?
Troubleshooting MongoDB Connection Failures
Shard Removal Task: Guide for Confirming the Progress and Troubleshooting Issues
Performance Fine-Tuning
Ops and Development Guide
Development Specifications
Command Support in Sharded Cluster v3.2
Command Support in v3.6
Development Ops
Troubleshooting
Increased Slow Queries
Number of Connections Exceeding Limit
API Documentation
History
Introduction
API Category
Making API Requests
Instance APIs
Backup APIs
Account APIs
Other APIs
Task APIs
Introduction
Data Types
Error Codes
Instance Connection
Shell Connection Sample
PHP Connection Sample
Node.js Connection Sample
Java Connection Sample
Python Connection Sample
Python Read/Write Sample
Go Connection Sample
PHP Reconnection Sample
Product Performance
Test Environment
Test Method
Test Result
FAQs
Cost
Features
Sharded Cluster
Instance
Rollback and Backup
Connection
Data Migration
Others
Service Agreement
Service Level Agreement
Terms of Service
Glossary
Contact Us

Adding Read-Only Node

PDF
Focus Mode
Font Size
Last updated: 2025-02-06 18:00:58

Overview

When your business has a massive number of read requests, the primary and secondary database nodes may struggle to handle them, causing high latency, slow response, and severely dropped throughput. To solve this problem, TencentDB for MongoDB provides read-only nodes with an independent connection address, allowing data to be synced from a primary or secondary node with the lowest latency through oplog. You can create one or multiple read-only nodes to implement read/write separation and relieve the access pressure on the primary and secondary nodes.
Two or more nodes can implement load balancing for read requests and guarantee a high availability; that is, when a read-only node fails, the system will automatically switch it with a hidden node. If automatic switch isn't performed, you can switch the node on the Node Management tab, and the connection address to the node will remain unchanged. You can directly get the connection string in the Network section on the Instance Details page.
If a read-only node isn't in the candidate list of the primary node, it won't be elected as the primary node or participate in the election.

Version Description

TencentDB for MongoDB version 4.0 and later support adding read-only nodes.

Directions

2. In the MongoDB drop-down list on the left sidebar, select Replica Set Instance or Shard Instance. The directions for replica set instances and sharded instances are similar.
3. Above the Instance List on the right, select the region.
4. In the instance list, find the target instance.
5. Click the Instance ID to enter the Instance Details page and click the Node Management tab.
6. On the Mongod Node tab, click Add Read-only Node.

Parameter
Description
Instance Specification
Check the current specification of the instance, including the CPU core quantity, memory, disk capacity, total node quantity, and read-only node quantity to evaluate the number of read-only nodes to be added.
Add Read-Only Node
The number of new read-only nodes. Value range: 0–5.
AZ
The AZ where all read-only nodes are deployed. This parameter will be displayed if the instance nodes are in the same AZ.
Compare
Compare the specifications before and after adding the read-only node to evaluate whether the new specification meets your needs.
The specification of a replica set instance includes mongod specification, disk capacity, number of read-only nodes, and maximum number of connections.
The specification of a sharded cluster instance includes number of shards, mongod specification, disk capacity, number of read-only nodes, and maximum number of connections.
Total Fees
Pay-as-you-go: Hourly unit price after instance speciation adjustment. You can click Billing Details to view the billable items and billing formula and confirm the fees.
7. Click OK.
8. On the left sidebar, select Task Management. In the task list, find the instance by ID or name and wait until the Task Status for adding the read-only node is marked as Completed.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback