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.
- The dedicated proxy is enabled. For more information, see Enable the dedicated proxy service for an ApsaraDB RDS for MySQL instance.
- Proxy terminals are enabled. For more information, see Enable proxy terminals on an ApsaraDB RDS for MySQL instance.
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.
You can enable or disable the transaction splitting feature based on your business requirements.
- Visit the RDS instance list, select a region above, and click the target instance ID.
- In the left-side navigation pane, click Database Proxy.
- On the Proxy Terminal (Original Read/Write Splitting) tab, click Enable or Disable to the right of Transaction Splitting.
Note After you enable or disable the transaction splitting feature, the new setting is applied only to new connections.
|DescribeDBProxy||Queries details about the dedicated proxy of an RDS instance.|
|DescribeDBProxyEndpoint||Queries the proxy endpoints that are used to connect to the dedicated proxy of an RDS instance.|
|ModifyDBProxyEndpoint||Modifies a proxy endpoint that is used to connect to the dedicated proxy of an RDS instance.|