You can create one or more read-only MyBase for MySQL instances to offload read requests from your primary 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

A MyBase for MySQL instance is created. For more information, see Create a MyBase for MySQL instance.

Background information

For more information about ApsaraDB for MyBase, see What is ApsaraDB for MyBase?.

Notes

  • If you update the kernel version of a primary instance, the kernel versions of all the read-only instances 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 configuration of a primary instance, all the read-only instances associated with the primary instance are automatically restarted.
  • You can associate up to five read-only instances with a primary instance. If you need to create more read-only instances, submit a ticket.
  • The storage capacity of each read-only instance must be greater than or equal to that of the primary instance. Before you increase the storage capacity of the primary instance to scale up your database system, increase the storage capacity of the read-only instances.
  • When a primary instance is released upon expiration, all the read-only instances associated with the primary instance are released.

Procedure

  1. Log on to the ApsaraDB for MyBase console.
  2. In the top navigation bar, select the deployment region.
    Select a region
  3. In the left-side navigation pane, click Clusters. On the page that appears, find the dedicated cluster that you want to manage and click Details in the Actions column.
  4. Find the primary instance for which you want to create a read-only instance, and choose More > Create Read-only Instance in the Actions column.
  5. In the panel that appears, configure the following parameters.
    Configure the parameters for a read-only instance
    Parameter Description
    Instance Type Select an instance type for the read-only instance.
    Storage Capacity The storage capacity of the read-only instance. You can specify a storage capacity for the read-only instance based on the remaining storage capacity of your database.
    Note You 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 as the deployment method.
    VSwitch Specify the vSwitch to which the read-only instance is connected. You can log on to the Virtual Private Cloud (VPC) console to view the detailed information about the vSwitch.
  6. Click OK.
    Note If you set Storage Type to Enhanced SSD (Recommended), complete the payment on the page that appears.

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 by ApsaraDB RDS. This way, write requests are automatically directed to the primary instance and read requests are automatically distributed to read-only instances based on the read weights of these instances. For more information, see Enable the proxy terminal feature for an ApsaraDB RDS for MySQL instance.