Files
doc-exports/docs/rds/umn/rds_11_0017.html
wangdengke2 ac787f42f1 rds_umn
Reviewed-by: Wagner, Fabian <fabian.wagner@t-systems.com>
Co-authored-by: wangdengke2 <wangdengke2@huawei.com>
Co-committed-by: wangdengke2 <wangdengke2@huawei.com>
2026-02-05 14:42:55 +00:00

10 KiB

Enabling Read/Write Splitting

You can enable database proxy for your RDS for MySQL instance to automatically forward read and write requests through a proxy address. To reduce read pressure of the primary instance, write requests are forwarded to the primary instance and read requests to read replicas based on the routing policy of the database proxy.

Precautions

Keep in mind the following notes on database proxies:
  • Before enabling database proxy, ensure that you have purchased an RDS for MySQL instance.
  • Both the primary instance and read replicas must be available.

Enabling a Single Proxy

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click Service List. Under Database, click Relational Database Service. The RDS console is displayed.
  4. On the Instances page, click the target DB instance. The Overview page is displayed.
  5. In the navigation pane on the left, choose Database Proxy.

    Alternatively, in the Connectivity area on the Overview page, click Configure in the Read/Write Splitting Address field.

  6. On the displayed page, click Create Database Proxy.
  7. Configure parameters and click Next.

    Table 1 Parameter description

    Parameter

    Description

    Proxy Name

    Set the proxy name based on service requirements.

    Role

    • Read and write: Read and write requests are split.
    • Read only: The proxy is not connected to your primary instance and cannot receive write requests.

    Routing Policy

    • Weighted: You can change the weights of your DB instance and read replicas after read/write splitting is enabled.
    • Load balancing: This policy is only available if proxy load balancing is enabled. After Load balancing is selected, read requests are automatically distributed to multiple read replicas based on the number of active connections to balance the load among these read replicas.

    You can change the routing policy after the database proxy is created. For details, see Configuring the Delay Threshold and Routing Policy.

    Reads Allowed on Primary

    This parameter is only available if Load balancing is selected.

    • Yes: Read requests can be routed to both the primary instance and read replicas, which increases the load of the primary instance. Configure this parameter as required.
    • No: Read requests are routed only to read replicas to offload read pressure from the primary instance.

    New Instance Class

    Select specifications for the proxy instance based on service demands. You can change the specifications after the proxy instance is created. For details, see Changing the Instance Class of a DB Proxy Instance.

    Proxy Nodes

    Enter an integer from 2 to 8. You can change the nodes after the proxy instance is created. For details, see Changing the Number of Proxy Nodes.

    • Read/write splitting maintains database connectivity but splits read and write requests. If read/write splitting is enabled, an additional address called a read/write splitting address is provided. To use read/write splitting, switch your applications to this address.
    • Read/write splitting address: You can connect to databases through the read/write splitting address, with read and write requests distributed to different databases automatically.

      The read/write splitting address and the floating IP address of the primary DB instance are in the same VPC and subnet and are independent from each other.

    • Delay threshold: You can set the delay threshold after read/write splitting is enabled. For details, see Configuring the Delay Threshold and Routing Policy.
    • DB instances for load balancing: You can select DB instances for load balancing after read/write splitting is enabled.

  8. Confirm the database proxy configuration.

    • To modify the configuration, click Previous.
    • If there is no need to change the settings, click Submit.

  9. View and manage the proxy on the Database Proxy page.

    You can view the read/write splitting address on the Overview page. Read and write requests can be split through the read/write splitting address.

    The read/write splitting address and the floating IP address of the DB instance are in the same VPC and subnet and are independent from each other.