You can create one or more read-only instances to elastically scale read capacity and reduce the load on your primary instance. Read-only instances are ideal for handling high-volume read traffic and can significantly increase your application's throughput.
Prerequisites
A primary instance is required. For more information, see Create an ApsaraDB for MyBase MySQL instance.
Background information
For more information about ApsaraDB for MyBase, see What is ApsaraDB for MyBase?.
Notes
When you upgrade the kernel minor version of a primary instance, the kernel minor version of its read-only instances also upgrades automatically. For more information, see Upgrade the kernel minor version.
If you change the specifications of the primary instance after a read-only instance is created, the system restarts the read-only instance.
The maximum number of read-only instances you can create depends on the primary instance edition: five for Master-replica Edition and seven for High-availability Edition.
Releasing an expired primary instance automatically releases its associated read-only instances.
Procedure
Log on to the ApsaraDB for MyBase console.
In the upper-left corner of the page, select the target region.
In the navigation pane on the left, click Clusters. Find the target cluster and click Details in the Actions column. On the cluster details page, you can Create Read-only Instance in one of the following ways.
Find the target instance and choose in the Actions column.
Find the target instance and click Details in the Actions column. In the navigation pane on the left, click Service Availability, and then click Add Node on the right side of the page.
NoteThis method is available only when the primary instance is of Master-replica Edition.
The Service Availability page displays the current primary node, read-only nodes, and MaxScale proxy endpoints in a topology diagram. The Add Node button is located at the bottom of the topology diagram.
Configure the following parameters.
Parameter
Description
Read-only instance switchable
Specifies whether a read-only instance can be promoted to a primary instance. This parameter is available only when the primary instance is of Master-replica Edition.
NoteAt least one read-only instance must be switchable.
Instance type
The instance type for the read-only instances.
Storage capacity
The storage capacity for each read-only instance. You can set this value based on the storage capacity usage of your primary instance.
NoteStorage capacity cannot be less than the primary instance's storage capacity.
Deployment method
You can select Default Policy or Specified Host.
VPC
The VPC where the read-only instances will be deployed.
VSwitch
The VSwitch for the read-only instances. You can view VSwitch details in the VPC console.
Click OK.
Related operations
After you create the read-only instances, you can update your application to use their endpoints for read-only traffic. You can also enable read/write splitting to automatically forward write requests to the primary instance and distribute read requests among the read-only instances based on their configured weights. For more information, see Add a database proxy endpoint.