A read-only instance is a replica of your primary ApsaraDB RDS for MySQL instance. Data changes on the primary instance are automatically synchronized to all associated read-only instances. Use read-only instances to offload read traffic from your primary instance and scale throughput for read-heavy workloads.
For other database engines, see Create an ApsaraDB RDS for SQL Server read-only instance and Create an ApsaraDB RDS for PostgreSQL read-only instance.
Prerequisites
Before you begin, verify that your primary instance meets all of the following requirements. Check the Basic Information page of the instance to confirm.
MySQL version: 8.0, 5.7, or 5.6
Billing method: subscription or pay-as-you-go (Serverless instances are not supported)
Edition: RDS High-availability Edition
Limits and behavior notes
Hard limits:
Up to 10 read-only instances per primary instance.
Read-only instances can only be created from a primary instance. Converting an existing instance is not supported.
The storage class of the read-only instance must match that of the primary instance.
Storage space:
Disk-based instances: Storage space cannot be smaller than the primary instance's storage space. If the primary instance has more memory than the read-only instance, the read-only instance restarts when you change the primary instance's specifications.
Local disk-based instances: Storage space cannot be smaller than the primary instance's storage space.
Read-only instances support only a local log retention policy. Automatic backup policies and manual backups are not supported (the primary instance's backups cover the data).
Virtual Private Cloud (VPC) options are limited when creating a read-only instance.
Behavioral notes:
Data is copied from the secondary node of the primary instance, so creating a read-only instance does not affect primary instance performance. However, you cannot change the primary instance's specifications while a read-only instance is being created.
Read-only instances do not inherit parameter settings from the primary instance. Default parameter values are applied. Modify parameters from the read-only instance's console if needed.
If the primary instance is released, subscription read-only instances are automatically refunded and released. Pay-as-you-go read-only instances are released immediately.
Billing method can be subscription or pay-as-you-go. For pricing, see Read-only instance types.
View the read-only instance and its endpoint
Log on to the ApsaraDB RDS console. In the left navigation pane, click Instances and select a region in the top navigation bar.
In the instance list, find the primary instance and click the arrow on its left to expand the associated read-only instances. Alternatively, click the primary instance ID to open its details page. Read-only instances are listed in Basic Information > Instance Distribution.


To view the endpoint of a read-only instance, click the read-only instance ID to open its details page. In Basic Information > Network Type, click View Details.

Monitor replication delay
A replication delay may occur when a read-only instance synchronizes data from the primary instance, typically during large transactions or DDL operations. Under normal conditions, the delay stays within 1 second. A delay exceeding 1 second indicates a synchronization lag; in extreme cases, the replication connection may break.
View the current replication delay on the Basic Information page of the read-only instance.
| Delay range | Status | Action |
|---|---|---|
| Within 1 second | Normal | No action required. |
| Exceeds 1 second | Synchronization lag | Investigate large transactions or DDL operations. See Causes and solutions for replication delays. |
| Replication connection broken | Extreme lag | Follow the troubleshooting guide in the link above. |
Configure read/write splitting
After adding a read-only instance, configure read/write splitting in one of two ways:
Manual routing in your application: Connect directly to the primary instance endpoint for writes and to the read-only instance endpoint for reads.
Database proxy (recommended): Enable the database proxy to automatically route read and write requests. The general-purpose database proxy and persistent connection features are free of charge. See [New Features] RDS for MySQL supports free general-purpose database proxy and persistent connection features.
For more information, see What is a database proxy?, What is read/write splitting?, and Enable the database proxy.
Take a read-only instance offline without downtime
When you need to remove a read-only instance from a read/write splitting environment, set its traffic weight to 0 first and wait for active sessions to drain before removing it.
The following example assumes a setup with primary instance A and read-only instances B and C, and that you want to take instance C offline.
Go to the RDS Instances page, select the region where instance A is located, and click the ID of instance A.
In the left navigation pane, click Database Proxy. In the Connection Topology Management section, click Modify Configuration.

In the Modify Proxy Endpoint (Terminal) Configuration dialog box, set the read weight to 0 for read-only instance C.

Go to the Monitoring and Alerts page for instance C. In the Session Connection section, monitor the
active_sessionmetric and wait for it to reach 0. If the value does not reach 0 after a prolonged period, kill the remaining sessions manually.
On the Database Proxy tab for primary instance A, remove instance C from the database proxy endpoint.
Frequently asked questions
Creation
Why can't I select a specific zone when creating a read-only instance?
Resources are unavailable in that zone. Select a different zone — it does not affect the functionality of the read-only instance.
Can the read-only instance use a different VPC than the primary instance?
It depends on the primary instance's network type and storage class:
If the primary instance is in a classic network, any VPC is valid for the read-only instance.
If the primary instance is in a VPC:
Local SSD storage: any VPC is valid.
Cloud disk storage: the VPC must match the primary instance's VPC.
Does creating a read-only instance affect the primary instance?
Data is copied from the secondary node of the primary instance, so primary instance performance is not affected. However, you cannot change the primary instance's specifications while the read-only instance is being created.
Can I add a read-only instance to a Basic Edition instance for read/write splitting?
Basic Edition instances do not support read-only instances directly. To use read/write splitting:
Upgrade to High-availability Edition: see Upgrade an instance from Basic Edition to High-availability Edition. Then add a read-only instance and enable the database proxy.
Upgrade to Cluster Edition: see Upgrade an instance from Basic Edition to Cluster Edition. Use the primary and secondary nodes to implement read/write splitting without a separate read-only instance.
Can I select primary and secondary zones for a High-availability Edition read-only instance?
Zone selection is available only when the primary instance is a disk-based instance running Milvus version 20210430 or later.
Data sync and replication latency
How long does data synchronization take?
Under normal conditions, synchronization is real time. A replication delay may occur during large transactions or DDL operations. The actual delay varies.
How can I tell if replication is healthy?
A replication delay within 1 second is normal. A delay exceeding 1 second indicates a synchronization lag. In extreme cases, the replication connection may break.
What causes replication delays?
See Causes and solutions for replication delays of ApsaraDB RDS for MySQL read-only instances.
Do read-only instances support parallel replication?
Yes.
Connection and routing
How do I force requests to go to the primary instance?
Three options are available:
Connect directly to the primary instance's internal or public endpoint.
Encapsulate requests in a transaction. When the database proxy is enabled and transaction splitting is disabled, all operations within a transaction are routed to the primary instance.
Use Hint syntax to explicitly route requests. See Hint syntax.
Does the read-only instance have its own endpoint?
Yes. Each read-only instance has a dedicated endpoint, listed in Basic Information > Network Type on the instance's details page.
Instance O&M
The read-only instance is using more storage than the primary instance. Is this normal?
Yes. The primary instance executes original SQL statements (
INSERT,UPDATE, and so on), while the read-only instance replays row-based binary logging events. This difference in InnoDB page writing mechanisms can cause page splits and more internal storage fragmentation on the read-only instance. In scenarios with frequent updates, deletions, or large transactions, the ibdata1 file, undo log, and temporary files on the read-only instance may grow faster than on the primary instance.To reclaim space, recreate the read-only instance: after enabling read/write splitting with the database proxy, create a new read-only node, verify it is functioning as expected, then delete the old node.
For a High-availability Edition read-only instance, how do I configure parameters for both the primary and secondary nodes?
Set parameters on the primary node of the read-only instance. The secondary node automatically syncs parameter values from the primary node. Direct modification of the secondary node is not supported.
Can a read-only instance be converted into a regular instance?
No.
Do I need to back up the read-only instance?
No. Back up data from the primary instance. Snapshot backups have no performance overhead on the primary instance.
How are binary logs purged?
Binary logs are automatically or manually deleted based on configured rules.
Does changing the configuration, releasing, or changing the billing method of a read-only instance affect the primary instance?
No.
Billing
Can I change the billing method of a read-only instance?
Yes. See Change from pay-as-you-go to subscription or Change from subscription to pay-as-you-go.
How can I estimate the cost of a read-only instance?
Log on to the ApsaraDB RDS console, go to the read-only instance creation page, and configure the instance type and storage space. The page displays a cost estimate based on your selections.
API reference
| API | Description |
|---|---|
| Create a read-only instance | Creates an RDS read-only instance |