Configuring Transaction Splitting
Scenarios
In most cases, an RDS for MySQL proxy instance sends all requests in transactions to the primary DB instance to ensure transaction correctness. However, in some frameworks, all requests are encapsulated into transactions that are not automatically committed using set autocommit=0. This causes heavy loads on the primary DB instance.
Function
Database proxies support transaction splitting. With this feature enabled, RDS can route the read requests prior to write operations in a transaction to read replicas, reducing the pressure of the primary DB instance.
Transaction splitting is disabled by default. If it is enabled under the default READ COMMITTED transaction isolation, RDS only starts a transaction for write operations when automatic commit is disabled. Before the transaction starts, read requests are routed to read replicas through load balancers.
Precautions
- Enabling transaction splitting affects global consistency of certain workloads. Before enabling this feature, evaluate its impact on your workloads.
- Before enabling transaction splitting, you need to upgrade the database proxy to the latest version because the transaction processing logic has been optimized in the latest version.
- After transaction splitting is enabled, read requests of the transactions committed using BEGIN cannot be routed to read replicas.
- After transaction splitting is enabled, read requests of transactions started using SET AUTOCOMMIT = 0 cannot be routed to read replicas.
Configuring Transaction Splitting
Transaction splitting takes effect only for connections established after this feature is enabled or disabled.
- Log in to the management console.
- Click in the upper left corner of the page and choose Databases > Relational Database Service.
- On the Instances page, click the primary instance name. The Basic Information page is displayed.
- In the navigation pane on the left, click Database Proxy.
- On the displayed page, click next to Transaction Splitting.
- In the displayed dialog box, click OK.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.