This topic describes how to enable and disable the transaction splitting feature that is provided in the database proxy of a primary ApsaraDB RDS for MySQL instance. This feature allows ApsaraDB RDS to route the read requests prior to write operations in a transaction to the read-only RDS instances of your database system. This reduces the loads on the primary RDS instance.
Prerequisites
Background information
set autocommit=0;
command. As a result, all requests are encapsulated in the transactions that are
not automatically committed. This causes heavy loads on the primary RDS instance.
In this case, you can enable the transaction splitting feature.
By default, the transaction splitting feature is enabled with the default isolation level READ COMMITTED. If the autocommit mode is disabled, ApsaraDB RDS starts a transaction only for write operations. In addition, before the transaction starts, ApsaraDB RDS routes all read requests to the read-only RDS instances by using a load balancer.
- Explicit transactions cannot be split. These explicit transactions include the transactions that are started by using BEGIN or START statements.
- After you enable the transaction splitting feature, global consistency cannot be ensured. Before you enable this feature, we recommend that you evaluate whether this feature is suitable for your workloads.

Procedure
You can enable or disable the transaction splitting feature based on your business requirements.
Related operations
Operation | Description |
---|---|
DescribeDBProxy | Queries details about the dedicated proxy instances that are enabled on an ApsaraDB RDS instance. |
DescribeDBProxyEndpoint | Queries the endpoints that are used to connect to the dedicated proxy of an ApsaraDB RDS instance. |
ModifyDBProxyEndpoint | Modifies a proxy endpoint that is used to connect to the dedicated proxy of an ApsaraDB RDS instance. |