TDSQL instances support read-write separation in the following modes:
Global read-write separation: the proxy enables the syntax parsing configuration to filter out SELECT read requests and send them directly to the secondary server by default.
A comment flag such as
/*slave*/ can be added to send specified SQL statements to the secondary server.
Comment flags including
/*slave:slaveonly,20*/are also supported, where the value indicates the delay requirement that the secondary server should satisfy, and
slaveonlyindicates that the query will not be sent to the primary server if there is no eligible secondary server.
Requests sent by read-only accounts are sent to the secondary server according to the configured attributes.