All Products
Search
Document Center

ApsaraDB RDS:Enable the database proxy feature

Last Updated:Feb 28, 2026

The database proxy feature for ApsaraDB RDS for PostgreSQL sits between your application and the RDS instance, providing read/write splitting and transaction splitting. Use it to offload requests from the primary instance, handle high connection volumes, and distribute workloads across read-only instances.

Prerequisites

Before you begin, make sure that:

  • The RDS instance runs PostgreSQL 10 or later

  • The RDS instance uses cloud disks

  • The RDS instance runs RDS High-availability Edition

  • The RDS instance is a primary RDS instance

  • The RDS instance does not reside in Hangzhou Zone C or Hangzhou Zone D. If it does, migrate the instance to another zone before enabling database proxy.

Billing

Proxy typeCost
General-purposeFree of charge
DedicatedPay-as-you-go. For details, see Billing rules for database proxies.

Proxy types

ApsaraDB RDS for PostgreSQL offers two proxy types. For a detailed comparison, see What are database proxies?

AspectGeneral-purposeDedicated
CostFreePay-as-you-go
Maximum specification16 CPU cores32 CPU cores
Specification at enablementSystem-recommended (adjustable later)User-configurable

Sizing guidance

The proxy specification is calculated as:

Specification = Recommended number of proxies x 2 CPU cores

The unit specification of each database proxy is fixed at 2 CPU cores. The recommended number of proxies depends on the proxy type:

Proxy typeRecommended count formula
General-purpose(CPU cores of primary instance + CPU cores of all read-only instances) / 4, rounded up
Dedicated(CPU cores of primary instance + CPU cores of all read-only instances) / 8, rounded up

Example: A primary RDS instance (RDS High-availability Edition) with 8 CPU cores and a read-only instance with 4 CPU cores produces a dedicated proxy count of ceil((8 + 4) / 8) = 2. The recommended specification is 2 x 2 = 4 CPU cores.

Enable database proxy

  1. Go to the Instances page. In the top navigation bar, select the region of your RDS instance, then click the instance ID.

  2. In the left-side navigation pane, click Database Proxy.

  3. Select a proxy type (General-purpose or Dedicated) and click Enable Now.

    • General-purpose -- The system automatically assigns the recommended specification. After enablement, you can adjust it.

    • Dedicated -- Configure the proxy specification during enablement.

    Note

    If prompted that service-linked role (SLR) authorization is incomplete, click Authorize, then click OK in the dialog box. Alibaba Cloud creates a service-linked role named AliyunServiceRoleForRdsProxyOnEcs that allows the database proxy to bind elastic network interfaces (ENIs) and establish network connections.

  4. Click OK.

Verify enablement

After the database proxy is enabled, the Database Proxy page displays the proxy's basic information, node details, and connection endpoints.

Basic Information

ParameterDescription
Primary InstanceThe ID of the RDS instance.
Proxy Instance StatusThe current status of the database proxy instance.
Proxy TypeGeneral-purpose or Dedicated. For differences, see What are database proxies?
ZoneThe zone of the database proxy instance. By default, this matches the zone of the primary RDS instance.
Proxy SpecificationsThe total specification of the database proxy, calculated as Unit specification (2 CPU cores) x Number of proxies. For example, 3 proxies produce a specification of 2 x 3 = 6 CPU cores.
Proxy VersionThe database proxy version.
Proxy Instance IDThe ID of the proxy instance.

Proxy Node

ParameterDescription
Node IDThe ID of the proxy node.
ZoneThe zone of the proxy node.
CPU Cores on Proxy NodeThe specification of a single proxy node.

Connection Information

ParameterDescription
Proxy Endpoint (Terminal) IDThe ID of the database proxy endpoint. Each RDS instance supports up to seven database proxy endpoints. Each endpoint can have one internal endpoint and one public endpoint. Hover over the endpoint ID to view its Read/Write Attributes and Read Weight Information. For configuration details, see Configure the connection settings for a database proxy endpoint and Use a database proxy endpoint to connect to an ApsaraDB RDS for PostgreSQL instance.
Read/Write AttributesThe read/write mode of the proxy endpoint: Read/Write or Read-only. For details, see Configure the read/write attributes and the read weight of the database proxy.
Internal Endpoint/PortThe internal endpoint and port for connecting to the RDS instance over the internal network through the database proxy. The internal endpoint is bound to the proxy endpoint ID. Click the image.png icon next to the endpoint to modify the endpoint prefix or port. For details, see Manage the database proxy endpoints.
Public Endpoint/PortThe public endpoint and port for connecting to the RDS instance over the Internet through the database proxy. An internal endpoint is provided by default; apply for a public endpoint separately. After applying, click the image.png icon next to the endpoint to modify the endpoint prefix or port. For details, see Manage the database proxy endpoints.

Important considerations

  • After the database proxy feature is enabled, we recommend that you do not migrate the primary RDS instance across zones. If you migrate the primary RDS instance across zones, the primary RDS instance and its proxy instances are in different zones. This increases access latency and slows down responses.

    Note

    If a primary/secondary switchover is triggered by a service failure, the primary RDS instance and its database proxy instances may end up in different zones. To reduce latency, perform another primary/secondary switchover to bring them back into the same zone. For details, see Switch workloads over between primary and secondary ApsaraDB RDS for PostgreSQL instances.

  • A read-only RDS instance must exist for the primary instance before you can configure connection settings for a database proxy endpoint. Without a read-only instance, you can enable the database proxy feature but cannot configure connection settings. To create one, see Create a read-only ApsaraDB RDS for PostgreSQL instance.

Next steps

API reference

APIDescription
ModifyDBProxyEnable or disable the database proxy feature for an instance.
DescribeDBProxyQuery the details of a database proxy.