Read-only instances offload read traffic from your primary ApsaraDB RDS for PostgreSQL instance. Physical replication synchronizes data from the primary instance to each read-only instance in real time, keeping data consistent across all instances.
For more information about read-only instances, see PostgreSQL read-only instances.
Prerequisites
Your primary RDS instance must meet all of the following requirements:
Version: An available (non-discontinued) version. Read-only instances cannot be created for discontinued versions. For more information, see Release notes for AliPG (PostgreSQL 14~17).
Series: High-availability series
Instance type: If the primary instance uses Premium Local SSDs, a dedicated instance type with at least 8 CPU cores and 32 GB of memory is required. No special requirements apply to other storage types.
Billing method: Subscription or pay-as-you-go. Serverless ApsaraDB RDS instances are not supported.
Check the edition and instance type of your primary instance on the Basic Information page. If the primary instance does not meet the requirements, click Change Specifications to upgrade from Basic Edition to High-availability Edition, and then create the read-only instance. For more information, see Change instance specifications.
Before you begin
Select the same virtual private cloud (VPC) as the primary instance for the read-only instance. Otherwise, the instance fails to be created and a refund is issued.
During creation, data is replicated from the secondary RDS instance to the read-only instance. This prevents interruptions to workloads running on the primary instance.
Read-only instances do not inherit the parameter settings of the primary instance. Default parameter settings are generated. Modify these settings in the ApsaraDB RDS console as needed.
Read-only instances attached to primary instances of a new general-purpose instance type do inherit the parameter settings of the primary instance. For more information, see Instance types for read-only ApsaraDB RDS for PostgreSQL instances.
Procedure
Go to the RDS instance list, select a region, and click the ID of the primary instance.
In the Instance Distribution area, click Add next to Read-only Instance.
NoteIf you use the previous version of the console, click Add Read-only Instance on the right.

Configure the following parameters.
NoteEach instance type supports a specific number of CPU cores, memory capacity, maximum connections, and maximum IOPS. If the primary instance uses Premium Local SSDs, read-only instance specifications must be greater than or equal to the primary instance specifications. For more information, see Instance types for read-only RDS for PostgreSQL instances.
Parameter Description Billing Method Subscription: One-time payment for long-term use. Pay-as-you-go: Billed by the hour for short-term use. After confirming the instance meets your needs, change the billing method to subscription. Product Type YiTian is available only when the Storage Type of the primary instance is ESSD or Premium ESSD. For more information about Standard and YiTian, see Product types. Zone Each zone is an independent physical location within a region. Multi-zone deployment supports zone-disaster recovery. Instance Type General-purpose Instance Types: The instance exclusively occupies allocated memory and I/O resources, but shares CPU and storage resources with other general-purpose instances on the same host. Dedicated Instance Types: The instance exclusively occupies CPU, memory, storage, and I/O resources. Dedicated host instance types provide the highest specifications and exclusively occupy all resources on the physical host. Storage Capacity Storage for data files, system files, write-ahead log (WAL) files, and transaction files. Adjustable in 5 GB increments. Cannot be less than the storage capacity of the primary instance. For more information, see Instance types for read-only RDS for PostgreSQL instances. Click Next: Instance Configuration and configure the following parameters.
Parameter Description Network Type By default, the network type, VPC, and vSwitch of Primary Node match the primary instance. Release Protection Available only when Billing Method is Pay-as-you-go. Prevents accidental instance release. For more information, see Enable or disable Instance Release Protection. Resource Group Same as the primary instance. Cannot be modified. Time Zone Same as the primary instance. SLR Authorization No configuration needed. Permissions are granted when the primary instance is purchased. For more information, see SLR authorization required from October 10, 2022. Instance Name A description to identify the read-only instance. Click Next: Confirm Order.
Read the Terms of Service, click Confirm Order, and complete the payment.
Expected creation time
The time required to create a read-only instance depends on the storage type.
| Storage type | Estimated time |
|---|---|
| Standard SSD | Approximately 20 minutes plus the time for a full backup |
| Enterprise SSD (ESSD) | Approximately 20 minutes |
The primary instance is not affected during the creation process. After the read-only instance is created, a WAL Sender process starts on the primary instance to send WAL files to the read-only instance.
In ApsaraDB RDS for PostgreSQL, snapshots are used to create read-only instances regardless of data volume.
View a read-only instance
From the instance list
Log on to the ApsaraDB RDS console, click Instances in the left navigation bar, and select a region.
Find the primary instance (marked with the
icon) and expand its dropdown list.
Click the ID of the read-only instance.
From the primary instance page
Go to the RDS instance list, select a region, and click the ID of the primary instance.
On the Basic Information page, hover over the read-only instance count and click a read-only instance ID.

Monitor replication latency
View the replication latency on the Basic Information page of the read-only instance.

Latency of 1 second or less indicates normal replication. Latency greater than 1 second indicates delayed replication, which may lead to disconnection.
Limits
The following table lists the constraints that apply to read-only instances based on the storage type of the primary instance.
| Constraint | Premium Local SSDs | Cloud disk |
|---|---|---|
| Maximum read-only instances | 5 | 32 |
| Architecture | High-availability (with standby node) | Single-node (no standby node) |
| Instance type requirement | Specifications and storage capacity must be greater than or equal to the primary instance | Specifications should be the same as the primary instance, or at least 50% of the primary instance specifications, to avoid replication latency and out-of-memory (OOM) errors |
| Storage capacity | Must be greater than or equal to the primary instance | Must be greater than or equal to the primary instance |
If the primary instance uses cloud disk storage and the memory of the primary instance exceeds the memory of a read-only instance, changing the specifications of the primary instance restarts the read-only instance.
Memory capacity requirements
The minimum memory for a read-only instance depends on the memory of the primary instance.
| Primary instance memory | Minimum read-only instance memory |
|---|---|
| (0 GB, 64 GB] | At least 1/4 of the primary instance memory |
| (64 GB, 256 GB] | At least 1/6 of the primary instance memory |
| (256 GB, 9999 GB] | At least 1/8 of the primary instance memory |
Additional constraints
The storage type of a read-only instance matches the storage type of the primary instance.
You can create read-only instances, but you cannot convert existing RDS instances to read-only instances.
Read-only instances are billed separately under the subscription or pay-as-you-go billing method. For more information about pricing, visit the ApsaraDB RDS buy page.
Because single-node architecture has no standby node, availability is not guaranteed. To improve availability, create multiple read-only instances and use libpq or Java Database Connectivity (JDBC) for automatic failover. For more information, see Automatic Failover and Read/Write Splitting. Alternatively, use a database proxy for automatic read/write splitting. For more information, see What is a database proxy.
API reference
| API | Description |
|---|---|
| CreateReadOnlyDBInstance | Creates a read-only instance. |
FAQ
Can I change the billing method of a read-only instance?
Yes. Switch between pay-as-you-go and subscription in either direction. For details, see Change from pay-as-you-go to subscription or Change from subscription to pay-as-you-go.
Does changing, releasing, or rebilling a read-only instance affect the primary instance?
No. Operations on a read-only instance have no impact on the primary instance.
Can I manage accounts on a read-only instance?
No. Accounts created on the primary instance are automatically synchronized to read-only instances with read-only permissions. Manage accounts on the primary instance only.
Can I convert a read-only instance into a regular instance?
No. Converting a read-only instance to a regular instance, such as a disaster recovery instance, is not supported.
Do I need to back up read-only instances?
No. Backups run on the primary instance using snapshot-based backups, which cause no performance overhead on the primary instance. Read-only instances do not need separate backups.
Does ApsaraDB RDS for PostgreSQL use parallel replication?
ApsaraDB RDS for PostgreSQL uses physical replication via WAL files for data synchronization and playback. This approach is more efficient than parallel replication.
How are transaction logs deleted?
After WAL files are backed up, AliPG clears the transaction logs during checkpointing.
What causes replication latency between a primary instance and a read-only instance?
Two common causes:
Specification mismatch: The primary instance has higher specifications than the read-only instance. Upgrade the read-only instance type. For more information, see Change configuration.
Misconfigured
max_standby_streaming_delayparameter: A value that is too small reduces latency but may cancel transactions on the read-only instance. A value that is too large increases latency. For more information, see Set instance parameters.