This topic describes how to create a read-only instance for your primary ApsaraDB RDS for MySQL instance. This allows your database system to process a large number of read requests. This also increases the throughput of your application. Each read-only instance is a replica of the primary instance. Data updates on the primary instance are synchronized to all of its read-only instances.

For more information about how to create a read-only instance in other database engines, see the following topics:

For more information about read-only instances, see Overview of read-only ApsaraDB RDS for MySQL instances.

Prerequisites

The instance runs one of the following MySQL versions and RDS editions:

  • MySQL 8.0 in the High-availability Edition or Enterprise Edition
  • MySQL 5.7 in the High-availability Edition or Enterprise Edition
  • MySQL 5.6
Note If your instance running MySQL 5.7 in the Enterprise Edition does not support read-only instances, submit a ticket.

Precautions

  • You can only create read-only instances for your primary instance. You cannot change existing instances to read-only instances.
  • When you create a read-only instance, the system replicates data from a secondary instance. Therefore, operations on your primary instance are not interrupted.
  • A read-only instance does not inherit the parameter settings of the primary instance. The system generates default parameter settings for the read-only instance, and you can modify the settings in the ApsaraDB for RDS console.
  • The maximum number of read-only instances can vary based on the memory capacity.
    Database engine Memory capacity Maximum number of read-only instances
    MySQL ≥ 64 GB 10
    < 64 GB 5
  • Billing method: A read-only instance is charged on an hourly basis. The actual fee can vary based on the instance type at the time when fees are deducted. For more information about pricing, see the descriptions of read-only instances in Pricing of ApsaraDB RDS for MySQL.

Create a read-only instance

  1. Log on to the ApsaraDB for RDS console.
  2. In the left-side navigation pane, click Instances. In the top navigation bar, select the region where the target RDS instance resides.
    Select a region
  3. Find the target instance and click the instance ID.
  4. In the Distributed by Instance Role section of the Basic Information page, click Create Read-only Instance.
  5. Configure parameters for the read-only instance.
    Parameter Description
    Zone The zone where the new RDS instance resides. Each zone is an independent physical location within a region. No substantive differences exist between zones in the same region. Multi-zone deployment provides zone-disaster recovery for your business.
    Instance Type
    • Entry-level: belongs to the general-purpose instance family. A general-purpose instance exclusively occupies the allocated memory and I/O resources. However, it shares CPU and storage resources with other general-purpose instances that are deployed on the same server.
    • Enterprise-level: belongs to the dedicated instance family. A dedicated instance exclusively occupies the allocated CPU, memory, storage, and I/O resources. The top configuration of the dedicated instance family is the dedicated host instance family. A dedicated host instance exclusively occupies all the CPU, memory, storage, and I/O resources of the server where it is deployed.
    Note Each instance type supports a specific number of CPU cores, memory capacity, maximum number of connections, and maximum IOPS. For more information, see Primary instance types.
    Capacity The storage capacity that the RDS instance has available to store data files, system files, binary log files, and transaction files. You can adjust the storage capacity in increments of 5 GB.
    Note If you select local SSDs, the storage capacity of the RDS instance varies based on the instance type. This restriction does not apply if you select standard or enhanced SSDs. For more information, see Primary instance types.
  6. Click Next:Instance Configuration and set the following parameter.
    Parameter Description
    Network Type
    • Classic Network: a traditional type of network.
    • VPC: A virtual private cloud (VPC) is an isolated network that provides higher security and better performance than the classic network. If you select the VPC network type, you must also specify the VPC and VSwitch of Primary Node parameters.
    Note The RDS instance must have the same network type as the ECS instance that you want to connect. If the RDS and ECS instances both have the VPC network type, they must also reside in the same VPC. Otherwise, the RDS and ECS instances cannot communicate over an internal network.
  7. Click Next:Confirm Order.
  8. Read and select Terms of Service and click Pay Now.

View a read-only instance

To view a read-only instance on the Instances page, perform the following steps:

  1. Log on to the ApsaraDB for RDS console.
  2. In the left-side navigation pane, click Instances. In the top navigation bar, select the region where the target RDS instance resides.
    Select a region
  3. Find the read-only instance and click its ID.

To view a read-only instance on the Basic Information page of its primary instance, perform the following steps:

  1. Log on to the ApsaraDB for RDS console.
  2. In the left-side navigation pane, click Instances. In the top navigation bar, select the region where the target RDS instance resides.
    Select a region
  3. Find the primary instance and click its ID.
  4. On the Basic Information page, move the pointer over the number of read-only instances and click the ID of the read-only instance that you want to view.

View the latency of a read-only instance

When a read-only instance synchronizes data from its primary instance, latency may occur. You can navigate to the Basic Information page of a read-only instance to view the latency of data synchronization to the instance.

FAQ

  • Can I select subscription billing for read-only instances?

    No, read-only instances support only pay-as-you-go billing. This makes it easier for you to change the instance specifications.

  • Why can a zone not be selected when I create a read-only instance?

    You cannot select a zone because the zone does not have available resources. In this case, select another zone. This does not affect your read-only instance.

  • Can I select a different VPC than the primary instance when I create a read-only instance?

    Yes, you can select a different VPC than the primary instance. A VPC is used to isolate external access to an RDS instance, such as access from an ECS instance to an RDS instance. Read-only instances are not subject to this limit.

Related operations

Operation Description
Create read-only instance Creates a read-only instance.