ApsaraDB RDS for MySQL provides the read/write splitting feature. This topic describes the notes that you must understand before you use this feature in your database system.
- When you change the specifications of the primary or read-only RDS instances, transient connection errors may occur.
- After you create a read-only RDS instance, only the requests over a new connection can be routed to the new instance.
- Dedicated proxy endpoints do not support compression protocols.
- If a dedicated proxy endpoint is used for connection, all the requests that are encapsulated in transactions are routed to the primary RDS instance.
- If a dedicated proxy endpoint is used for read/write splitting, the read consistency of the requests that are not encapsulated in transactions cannot be ensured. If you require the read consistency, you can encapsulate the requests in transactions.
- If a dedicated proxy endpoint is used for connection, the
SHOW PROCESSLISTstatement returns a result set for each query. The result set consists of the query results from the primary and read-only RDS instances.
- If the short-lived connection optimization feature is enabled, the
SHOW PROCESSLISTstatement may return idle connections.
- If you execute multi-statements or run stored procedures, the read/write splitting feature is disabled. In this case, all the subsequent requests over the current connection are routed to the primary RDS instance. To enable the read/write splitting feature again, you must close the current connection and establish a new connection. For more information, see the MySQL official documentation.
- If you use the MySQL command line tool to establish a connection and execute hints,
you must add the
-cparameter to these hints. If you do not add this parameter to a hint, the MySQL command line tool filters this hint out. For more information about the hint syntax, see Execute hints on an ApsaraDB RDS for MySQL instance.