You can create one or more read-only ApsaraDB MyBase for MySQL instances to offload read requests from your primary ApsaraDB MyBase for MySQL instance in an ApsaraDB for MyBase dedicated cluster. This improves the read performance of the database and increases the throughput of your application.
Prerequisites
An ApsaraDB MyBase for MySQL instance is created. For more information, see Create an ApsaraDB MyBase for MySQL instance.
Background information
For more information about ApsaraDB for MyBase, see What is ApsaraDB for MyBase?
Usage notes
After you update the kernel minor version of a primary instance, the kernel minor versions of all the read-only instances that are associated with the primary instance are updated. For more information, see Update the minor engine version of an ApsaraDB RDS for MySQL instance.
If you modify the configurations of a primary instance, all the read-only instances that are associated with the primary instance are restarted.
You can create at most five read-only instances of Master-replica Edition and at most seven read-only instances of High-availability Edition. To increase the quota, submit a ticket.
When a primary instance is released upon expiration, all the read-only instances that are associated with the primary instance are automatically released.
Procedure
Log on to the ApsaraDB for MyBase console.
In the upper-left corner of the page, select a region.
In the left-side navigation pane, click Clusters. Find the dedicated cluster that you want to manage and click Details in the Actions column to go to the details page. You can use one of the following methods to Create Read-only Instance.
Find the instance that you want to manage, and choose
in the Actions column.Find the instance that you want to manage and click Details in the Actions column. In the left-side navigation pane, click Service Availability and click Add Node on the right side.
NoteThis method is supported only when the primary instance uses Master-replica Edition.
Set the following parameters.
Parameter
Description
Read-only Instance Switchable
Specifies whether the read-only instance is allowed to be changed to a primary instance. This parameter is available only when the primary instance uses Master-replica Edition.
NoteYou must specify at least one read-only instance to support the switch.
Instance Type
Select the specifications of the read-only instance.
Storage Capacity
Specify the storage capacity of the read-only instance. You can specify the storage capacity based on the storage capacity usage of your database.
NoteYou must set the Storage Capacity parameter to a value that is greater than or equal to the storage capacity of the primary instance.
Deployment Method
You can select Default Policy or Specified Host.
VPC
Select the virtual private cloud (VPC) to which the host belongs.
VSwitch
Specify the vSwitch to which the read-only instance is connected. You can log on to the VPC console to view the detailed information about the vSwitch.
Click OK.
References
After a read-only instance is created, you can modify the code of your application and change the endpoint for read requests to the endpoint of the read-only instance. You can also enable the read/write splitting feature provided. This way, write requests are automatically directed to the primary instance and read requests are automatically distributed to read-only instances based on the weights of these instances. For more information, see Create a Database Proxy terminal for an ApsaraDB MyBase for MySQL instance.