This topic introduces the transaction splitting function provided by the database proxy of ApsaraDB for RDS. This function identifies and distributes read requests initiated before write requests within a transaction to read-only instances. This reduces workloads on the primary instance.
set autocommit=0;). This brings heavy workloads on the primary instance. In this case, you can enable the transaction splitting function.
When transaction splitting is enabled and the default isolation level READ COMMITTED is used, the RDS instance starts a transaction only for write requests when autocommit is disabled. Read requests that arrive before the transaction is started are distributed to read-only instances by the load balancer.
- Explicit transactions do not support splitting, such as transactions started by using the BEGIN or START statement.
- After transaction splitting is enabled, global consistency cannot be ensured. If your business requires global consistency, we recommend that you evaluate whether you can enable transaction splitting.
- Log on to the ApsaraDB for RDS console.
- In the left-side navigation pane, click Instances. In the top navigation bar, select the region where the target RDS instance resides.
- Find the target instance and click the instance ID.
- In the left-side navigation pane, click Database Proxy.
- In the Proxy Endpoint section of the Proxy Service tab, click Enable on the right of Transaction Splitting:.Note
- When you no longer need transaction splitting, you can click Disable on the right of Transaction Splitting:.
- The operation to enable or disable transaction splitting takes effect only on new connections.