This topic provides an overview of read-only ApsaraDB RDS for PostgreSQL instances. If your database system receives a large number of read requests but a small number of write requests, a single primary RDS instance may not be capable of processing the read requests at high speeds. This may even interrupt your workloads. In this case, you can create one or more read-only RDS instances that are used to offload read requests from the primary RDS instance. This increases both the read capability of your database system and the throughput of your application.

Background information

When a read-only RDS instance is being created, ApsaraDB RDS replicates data from the secondary RDS instance to the read-only RDS instance. After the read-only RDS instance is created, it has the same data as the primary RDS instance. In addition, after the data on the primary RDS instance is updated, ApsaraDB RDS immediately synchronizes the updates to all the read-only RDS instances that are attached with the primary RDS instance.

Note
  • If the primary RDS instance uses local solid-state drives (SSDs), you can create a maximum of 5 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 based on the high-availability architecture.
  • If the primary RDS instance uses standard or enhanced SSDs, its read-only RDS instances run based on the single-node architecture. In this 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 allows you to implement failovers among the created read-only RDS instances by using libpq or Java Database Connectivity (JDBC). For more information, see Configure automatic failover and read/write splitting.
The following figure shows the topology of the primary RDS instance and its read-only RDS instances. PostgreSQL topology

Billing

Read-only RDS instances are billed on a pay-as-you-go basis. For more information about the prices of read-only RDS instances, see Read-only ApsaraDB RDS instance types.

Features

  • Region and zone: A read-only RDS instance must reside in the same region as the primary RDS instance. However, the primary and read-only RDS instances can reside in different zones.
  • Specifications and storage capacity: If the primary RDS instance uses local SSDs, the specifications and storage capacity of a read-only RDS instance must be higher than or equal to those of the primary RDS instance.
  • Network type: A read-only RDS instance can have a different network type than the primary RDS instance. For more information, see Change the network type of an ApsaraDB RDS for PostgreSQL instance.
  • Account and database: The accounts and databases on a read-only RDS instance are synchronized from the primary RDS instance. Therefore, you do not need to manage the accounts or databases on a read-only RDS instance.
  • IP address whitelist: When a read-only RDS instance is being created, ApsaraDB RDS replicates the IP address whitelists of the primary RDS instance to the read-only RDS instance. However, the IP address whitelists on the read-only RDS instance are independent of those on the primary RDS instance. For more information about how to modify the IP address whitelists of a read-only RDS instance, see Configure an IP address whitelist for an ApsaraDB RDS for PostgreSQL instance.
  • Monitoring and alerting: You can monitor the performance metrics of a read-only RDS instance. These metrics include the disk usage, input/output operations per second (IOPS), number of connections, and CPU utilization.

Precautions

  • If the primary RDS instance uses local SSDs, you can create a maximum of 5 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.
  • Backups are created on the primary RDS instance. Read-only RDS instances do not support backup settings or manual backups.
  • You cannot migrate data to read-only RDS instances.
  • You cannot create or delete databases on read-only RDS instances.
  • You cannot create or delete accounts, grant permissions to accounts, or change the passwords of accounts on read-only RDS instances.
  • If the memory capacity that you specify for the primary RDS instance during a specification change is greater than the memory capacity of a read-only RDS instance, the read-only RDS instance restarts.
  • If a read-only RDS instance encounters errors such as failures to replicate database engine settings, ApsaraDB RDS rebuilds the read-only RDS instance.

FAQ

After I create accounts on my primary RDS instance, can I manage the accounts on the read-only RDS instances?

No, although the accounts that are created on your primary RDS instance are synchronized to the read-only RDS instances, you cannot manage the accounts on the read-only RDS instances. The accounts have only the read permissions on the read-only RDS instances.