Updated on 2024-04-11 GMT+08:00

Enabling Read/Write Splitting

Read/write splitting enables read and write requests to be automatically routed through a read/write splitting address. This section describes how to enable read/write splitting.

Prerequisites

There is at least one read replica created for your DB instance.

Procedure

  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 Instance Management page, click the target DB instance. The Basic Information page is displayed.
  5. In the navigation pane on the left, choose Database Proxy.

    Alternatively, in the Connection Information area on the Basic Information page, click Apply in the Read/Write Splitting Address field.

  6. On the displayed page, click Enable now.
  7. In the displayed dialog box, click OK.

    • Read/write splitting maintains the database connectivity and splits read and write requests. After 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 automatically distributed.

      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 section Configuring Delay Threshold and Distributing Read Weight.
    • Read weight distribution: You can set read weights distributed to read replicas and primary DB instances after read/write splitting is enabled. For details, see section Configuring Delay Threshold and Distributing Read Weight.