This topic describes how to create an RDS for MySQL read-only instance. You can create read-only instances to process massive read requests sent to the database and increase the application throughput. A read-only instance is a read-only copy of the master instance. Changes to the master instance are also automatically synchronized to all relevant read-only instances.

For more information, see Read-only instances overview.

Prerequisites

The MySQL version and RDS edition are as follows:
  • MySQL 8.0 High-availability Edition (with local SSDs)
  • MySQL 5.7 High-availability Edition (with local SSDs)
  • MySQL 5.6

Precautions

  • You can create read-only instances in your master RDS instance. However, you cannot switch an existing instance to a read-only instance.
  • Creating a read-only instance does not affect your master RDS instance because the read-only instance replicates data from the slave instance.
  • A read-only instance does not inherit the parameter settings of your master RDS instance. Instead, default parameter settings are generated. You can modify the parameter settings of a read-only instance on the RDS console.
  • The quantity of read-only instances is as follows.
    Database type Memory Max number of read-only instances
    MySQL ≥ 64 GB 10
    < 64 GB 5
  • A read-only instance is charged by using the pay-as-you-go billing method. Specifically, the fees for a read-only instance are deducted once per hour depending on the instance specifications. For more information, see the "Read-Only Instances" part at ApsaraDB RDS for MySQL pricing.

Create a read-only instance

  1. Log on to the RDS console.
  2. Select the target region.选择地域
  3. Find the target RDS instance and click the instance ID.
  4. Click Add Read-only Instance. 添加只读实例
  5. On the purchase page, choose the configuration of the read-only instance, and then click Buy Now.
    Note
    • We recommend that the read-only instance and its corresponding master instance be located in the same VPC.
    • To guarantee sufficient I/O for data synchronization, we recommend that the configuration of the read-only instance (specifically, the memory) is greater than or equal to that of the master instance.
    • We recommend that you purchase multiple read-only instances based on your business needs to improve availability.
  6. On the Order Confirmation page, read and confirm you agree to Terms of Service, Service Level Agreement, and Terms of Use by selecting the checkbox, confirm the order details, and click Pay Now.

    The instance creation takes a few minutes.

View a read-only instance

To view a read-only instance in the instance list, follow these steps:
  1. Log on to the RDS console.
  2. Select the target region.选择地域
  3. Find the target read-only instance and click the instance ID. 查看只读实例

To view a read-only instance on the Basic Information page for the master instance, follow these steps:

  1. Log on to the RDS console.
  2. Select the target region.选择地域
  3. Find the master instance and click the instance ID.查看主实例
  4. On the Basic Information page, move the pointer over the number below Read-only Instance and click the ID of the read-only instance.添加只读实例

View the delay time of a read-only instance

When a read-only instance replicates data from the master instance, the read-only instance may lag behind the master instance by a small amount of time. You can view the delay on the Basic Information page of the read-only instance.

查看只读实例的延迟时间

APIs

API Description
CreateReadOnlyDBInstance Used to create an RDS read-only instance.