6.3.2. Connector Quality of Service (QoS) Selection

Depending on the chosen routing and authentication method, the 'Quality of Service' (QoS) setting can be specified as part of the SQL statement, host, or user configuration, and affects the selection of the MySQL server:

  • RO_RELAXED

    This setting enables the connector to redirect the query as if it were read-only, and therefore prefer a slave over a master, but will choose a master if no slave is available.

  • RW_STRICT

    This setting indicates that the query is a write and should be directed to a master.

  • RW_SESSION

    Where possible, the QoS should be set for read/write splitting according to the current session state.

These hints for the connection can be set, for example by using the value in the comments during SQL routing, or by setting the corresponding QoS value in the user.map file.

Further, connectivity can be influenced by setting a suitable latency value, or an explicit affinity. This information can be specified either within the connection strings, within the user.map, or through configuration.

The rules for selection of whether a connection is made to a master or a slave is therefore controlled by comparing all of these settings and the selected routing mechanism together.

SmartScale QoS Maximum Applied Latency Selection Order Affinity Master Selected Slave Selected
Enabled Not Specified Not Specified Not Specified Slave:Master Yes Yes
Not Enabled RO_RELAXED Not Specified Not Specified Slave:Master Only if no slave available Yes
Not Enabled RO_RELAXED Specified Not Specified Slave:Master Only if no slave available Only if slave latency < --connector-max-applied-latency