This topic describes how to create a read-only RDS instance for a primary ApsaraDB RDS for PostgreSQL instance. Read-only RDS instances allow your database system to process more read requests. Read-only RDS instances also increase the throughput of your application. Each read-only RDS instance is a replica of the primary RDS instance. This means that each read-only RDS instance has the same data as the primary RDS instance. Data updates on the primary RDS instance are automatically synchronized to all the read-only RDS instances.

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

Prerequisites

  • The primary RDS instance runs PostgreSQL 10, 11, 12, or 13.
  • If the primary RDS instance uses local SSDs, it must be a dedicated RDS instance that provides at least 8 cores and 32 GB of memory. If the primary RDS instance uses standard or enhanced SSDs, no specific instance specifications are required.
  • The primary RDS instance runs the High-availability Edition. Before you create a read-only RDS instance, you must check the edition of the primary RDS instance on the Basic Information page. If the primary RDS instance runs the Basic Edition, you can click Change Specifications to upgrade the primary RDS instance from the Basic Edition to the High-availability Edition. For more information, see Change the specifications of an ApsaraDB RDS for PostgreSQL instance.

Precautions

  • You can create read-only RDS instances for the primary RDS instance. You cannot convert existing RDS instances into read-only RDS instances.
  • When you create a read-only RDS instance, ApsaraDB RDS replicates data from the secondary RDS instance to the read-only RDS instance. This prevents interruptions to your workloads on the primary RDS instance.
  • A read-only RDS instance does not inherit the parameter settings of the primary RDS instance. Your database system generates default parameter settings for the read-only RDS instance. You can modify these default parameter settings in the ApsaraDB RDS console.
  • If the primary RDS instance uses local SSDs, the specifications and storage capacity of a read-only RDS instance cannot be lower than those of the primary RDS instance.
  • If the primary RDS instance uses local SSDs, you can create a maximum of five read-only RDS instances. If the primary RDS instance uses standard or enhanced SSDs, you can create a maximum of 32 read-only RDS instances.
  • If the primary RDS instance uses local SSDs, its read-only RDS instances run in the high-availability architecture. If the primary RDS instance uses standard or enhanced SSDs, its read-only RDS instances run in the single-node architecture.
    Note In the single-node architecture, a read-only RDS instance does not have a secondary RDS instance as a standby. For availability purposes, we recommend that you purchase more than one read-only RDS instance. This way, you can implement failovers by using the libpq or Java Database Connectivity (JDBC) API. For more information, see Configure automatic failover and read/write splitting.
  • Read-only RDS instances are billed on a pay-as-you-go basis. For more information, see Read-only ApsaraDB RDS instance types.

Create a read-only RDS instance

  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the Distributed by Instance Role section, click Add next to Read-only Instance.
    Note If you are using the original ApsaraDB RDS console, you must click Create Read-only Instance in the Distributed by Instance Role section of the Basic Information page.
    Create a read-only RDS instance
  3. Configure the following parameters.
    Parameter Description
    Zone The zone where the read-only RDS instance resides. Each zone is an independent physical location within a region. Zones in the same region provide the same services. Multi-zone deployment provides zone-level disaster recovery for your business.
    Instance Type
    • General-purpose (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 the other general-purpose instances that are deployed on the same server.
    • Dedicated Instance (Enterprise-level): belongs to the dedicated instance family or the dedicated host instance family. A dedicated instance exclusively occupies the allocated CPU, memory, storage, and I/O resources. The dedicated host instance family is the top configuration of the dedicated instance family. A dedicated host instance exclusively occupies all the CPU, memory, storage, and I/O resources on the server where it is deployed.
    • Dedicated: A dedicated cluster exclusively occupies all the resources on a VM or physical host. The permissions to manage hosts in a dedicated cluster can be authorized to you. This allows you to create multiple database instances on a host. For more information, see Add hosts.
    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 read-only RDS instance has available to store data files, system files, binary log files, and transaction files. The storage capacity increases in increments of 5 GB.
    Note The dedicated instance family supports exclusive allocations of resources. Therefore, the storage capacity of each instance type with local SSDs in this family is fixed. For more information, see Primary instance types.
  4. Click Next: Instance Configuration and configure the following parameters.
    Parameter Description
    Network Type
    • Classic Network: the traditional type of network.
    • VPC: the recommended type of network. A virtual private cloud (VPC) is an isolated virtual 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 parameter and the vSwitch of Primary Node parameter. If you select the Multi-zone Deployment method in the Basic Configurations step, you must specify both the VSwitch of Primary Node and VSwitch of Secondary 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, these instances must also reside in the same VPC. Otherwise, these instances cannot communicate over an internal network.
  5. Click Next: Confirm Order.
  6. Read and select Terms of Service, click Pay Now, and then complete the payment.

A few minutes are required to create the read-only RDS instance.

View a read-only RDS instance

To view a read-only RDS instance on the Instances page, perform the following steps:
  1. Log on to the RDS management console, click on the left Instances , and then select a region above.
  2. Find the read-only RDS instance and click its ID.

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

  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. On the Basic Information page, move the pointer over the number of read-only RDS instances and click the ID of the read-only instance that you want to view. Go to the read-only RDS instance from the primary RDS instance

View the latency of data replication to a read-only RDS instance

When a read-only RDS instance synchronizes data from the primary RDS instance, a latency may occur. You can view the latency on the Basic Information page of the read-only RDS instance.

View the latency of data replication to a read-only RDS instance

Related operations

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