Read/Write Separation

Last updated: 2020-10-26 10:32:44

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.

    Note:

    Comment flags including /*slave:slaveonly*/, /*slave:20*/, and /*slave:slaveonly,20*/ are also supported, where the value indicates the delay requirement that the secondary server should satisfy, and slaveonly indicates 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.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback
Help