This topic describes the FAQ related to read/write splitting.

Why does the new read weights not take effect?

After you change the read weights, RDS allocates read and write requests based on the new weights only after a new connection is established. However, your application does not terminate the existing connection or reestablish a connection.

Why does the load on each of the master and read-only instances not comply with the specified read weight?

If the load on each of the master and read-only instances does not comply with the specified read weight, check the following two aspects:

  • Whether the request statements contain transactions. All requests that contain transactions, including transaction read requests, are routed only to the master instance.
  • Whether your application connects to each of the master and read-only instances only by using the read/write splitting address. If your application connects to any master or read-only instance by using the endpoint of this specific instance, RDS does not allocate requests to this instance based on the specified weight.

Why does RDS route read requests to the master instance when the read weight of the master master is 0?

Check the following two aspects:

  • Whether the request statements contain transactions. All requests that contain transactions, including transaction read requests, are routed only to the master instance.
  • Whether the unavailability duration or replication latency of each read-only instance with a specified read weight exceeds the preset threshold. If so, RDS determines that all the read-only instances are unavailable and therefore routes read requests to the master instance.

How does read/write splitting guarantee the timeliness of data reading?

For more information, see How does read/write splitting ensure the timeliness of data reading?.

How do I set read weights by calling API actions?

For more information, see ModifyReadWriteSplittingConnection.

How do I select the network type of the read/write splitting address?

If your application is deployed in the same VPC as the RDS instance, we recommend that you use the internal endpoint to guarantee data security and communication efficiency. If your application is deployed on your computer or in a different network from the RDS instance, you can use the public endpoint to establish a connection. For more information about how to switch between network types, see Change the network type of the read/write splitting address for an RDS for MySQL instance.

What is the difference between the read/write splitting address and the internal and public endpoints of the master instance?

After read/write splitting is enabled, a read/write splitting address is generated. You must add the read/write splitting address and the read weight of each instance to the configuration data in your application. Then, after the requests from the application reach this address, RDS automatically allocates them to each of the master and read-only instances based on the request types and the read weights.

If the connection address in your application is the internal or public endpoint of the master instance, then all the requests are routed to the master instance.

Can I change the read/write splitting address?

No. You cannot change the read/write splitting address. The read/write splitting address is fixed. It does not change as you enable or disable read/write splitting, therefore you do not need to modify the configuration data in your application frequently. This reduces maintenance costs.

Does adding a read-only instance have any impact on the master instance?

No. Adding a read-only instance does not have any impact on the master instance because the read-only instance replicates data from the slave instance.