All Products
Search
Document Center

ApsaraDB for MongoDB:Read-only nodes

Last Updated:Mar 28, 2026

Read-only nodes give your ApsaraDB for MongoDB instance a dedicated read tier with its own connection string URI (Uniform Resource Identifier). When primary and secondary nodes are saturated with read requests, add read-only nodes to absorb the excess load without touching your existing connections.

How it works

Read-only nodes sync data from whichever primary or secondary node has the lowest latency, using MongoDB's oplog mechanism. Replication is asynchronous: under normal conditions latency is millisecond-level, but it can rise to second-level when the primary node is under heavy write workloads.

Each read-only node runs at the same specifications as the primary and secondary nodes, so there is no resource contention and no performance penalty on the replica set.

Read-only node architecture diagram

Node roles at a glance:

  • Primary node — handles read and write requests.

  • Secondary node — handles read requests; can be elected primary if the primary node fails.

  • Read-only node — handles read requests only; never participates in primary elections and is not displayed in the alternative primary node list.

Read-only nodes vs. secondary nodes

Read-only nodeSecondary node
ReadsYesYes
WritesNoNo (unless elected primary)
Election participationNever — not displayed in the alternative primary node list and cannot be elected as primaryYes — can become primary on failover
Independent connection string URIYes — dedicated read-only URIYes — but may gain write access if elected primary
Load balancing across nodesYes — with 2 or more read-only nodes, the read-only URI distributes requests across all of themNo
High availabilityIf a node fails, the system automatically switches your business to a healthy node. If the automatic switchover does not occur, you can manually perform the switchover. Endpoints remain unchanged during this process.If the primary node fails, a secondary node can be elected as the new primary node.
Best forBI, big data analytics, workloads that must be fully isolated from the replica setSeparating read and write traffic while maintaining standard high availability
Each time node roles are switched, the instance may experience a 30-second transient connection interruption. Perform role switches during off-peak hours and make sure your application reconnects automatically. For details, see Switch node roles.

Use cases

  • Business intelligence (BI) and analytics — connect analysis servers directly to read-only nodes so reporting queries never compete with production traffic.

  • High read-to-write ratio workloads — scale out read capacity independently by adding nodes without changing application code that connects to the primary or secondary nodes.

Limitations

  • Read-only nodes are available only for replica set instances and sharded cluster instances.

  • Each replica set instance supports a maximum of five read-only nodes.

  • Each shard in a sharded cluster instance supports a maximum of five read-only nodes.

  • Read-only nodes handle read requests only and do not participate in primary elections.

  • Replication is asynchronous. Millisecond-level latency is typical; second-level latency may occur when the primary node has high write workloads.

Billing

A read-only node is billed at the same rate as a node in a replica set instance or a shard node in a sharded cluster instance.

Benefits

  • You can change the number of read-only nodes based on your requirements to reduce costs.

  • Read-only nodes have an independent connection string URI and are suitable for direct connection to independent systems. They do not interrupt connections to existing primary and secondary nodes.

  • Read-only, primary, and secondary nodes share the same specifications. This enables read-only nodes to synchronize data from the primary or secondary node with the lowest latency and eliminates maintenance overhead.

  • Read-only nodes are independent nodes that provide only read services and do not compete for resources with primary nodes. If you change the number of read-only nodes in an instance, the primary and secondary nodes are not affected and connections to them are not closed.

  • ApsaraDB for MongoDB provides a unified read-only connection string URI for replica set instances. You can use the URI to connect to all read-only nodes in a replica set instance. To extend database capabilities, you can add more read-only nodes without changing your application code.

What's next

Add read-only nodes when creating an instance:

Change the number of read-only nodes on an existing instance:

Connect to your instance: