Help Center > > User Guide> Working with RDS for MySQL> Database Proxy (Read/Write Splitting)> Introducing Read/Write Splitting

Introducing Read/Write Splitting

Updated at: May 14, 2021 GMT+08:00

Read/write splitting enables read and write requests to be automatically routed through a read/write splitting address. You can enable read/write splitting after read replicas are created. Write requests are automatically routed to the primary DB instance and read requests are routed to read replicas by user-defined weights.

To use read/write splitting, connect to DB instances through a private network because read/write splitting addresses are private IP addresses.

Before enabling read/write splitting, ensure that at least one read replica is available and the primary DB instance and read replica are in the same region.

After read/write splitting is enabled, the port number cannot be changed. You are advised to change the port number first, if needed.

Billing

The database proxy has been put into commercial use. You will be billed on an hourly basis based on the number of proxy nodes used. Pricing details are as follows.

Database proxy supports the pay-per-use billing mode.

Table 1 Pricing details (USD/hour)

CPU Type

Instance Class

CN North-Beijing 4, CN East-Shanghai 1, and CN South-Guangzhou

AP-Bangkok

AP-Singapore

AP-Hong Kong

x86

2 vCPUs | 4 GB

0.16

0.24

0.25

0.28

4 vCPUs | 8 GB

0.32

0.48

0.5

0.56

8 vCPUs | 16 GB

0.64

0.96

1

1.12

Database Proxy Kernel Version Description

2021-03-29

  • Upgrade the kernel version to 2.3.8.4.
  • Fix the issue that the proxy array is out of bounds because short connections are continuously established when there are large amounts of concurrent requests.

2021-03-10

  • Upgrade the kernel version to 2.3.8.2.
  • Fix the issue that an error is reported because the proxy does not support the prepared statement protocol during a sysbench pressure test.

2020-01-06

  • Upgrade the kernel version to 2.3.8.0.
  • Support transparent transmission of client IP addresses to RDS for MySQL 5.6 and 5.7.
  • Reconstruct the prepared statement protocol for proxy.

Constraints

When read/write splitting is enabled, the system automatically deletes the existing account rdsProxy and creates a new rdsProxy account. When read/write splitting is disabled, the system automatically deletes the existing account rdsProxy. To prevent the system from deleting your created rdsProxy account, you are advised not to create it.

  • RDS for MySQL 5.6 and 5.7 support read/write splitting, but MySQL 8.0 does not.
  • The MySQL 8.0 client does not support connections using the read/write splitting address.
  • There is at least one read replica created for a MySQL DB instance.
  • If you delete a primary DB instance after read/write splitting is enabled, the read replicas are also deleted and the read/write splitting function is disabled.
  • After read/write splitting is enabled, the database port, security group, and floating IP address of the primary DB instance and read replica cannot be changed.
  • Read/write splitting does not support SSL encryption.
  • Read/write splitting does not support the compression protocol.
  • Read/write splitting does not support the READ UNCOMMITTED transaction isolation level.
  • If multi-statements are executed, all subsequent requests will be routed to the primary DB instance. To restore the read/write splitting function, disconnect the connection from your applications and establish a connection again.
  • When read and write requests are split through the read/write splitting address, all transaction requests are routed to the primary DB instance while the non-transaction read consistency is not ensured. To ensure read consistency, encapsulate requests into transactions.
  • When the read/write splitting address is used, the LAST_INSERT_ID() function can be used only in transactions.
  • When the read/write splitting address is used, the execution results of the show processlist command are inconsistent.
  • When the read/write splitting address is used, the show errors and show warnings commands can be used only in transactions.
  • When the read/write splitting address is used, user-defined variables, such as the SET @variable statements, are not supported.
  • When the read/write splitting address is used, if stored procedures and functions depend on user variables (@variable), the execution result may be incorrect.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel