7.4.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:


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


    This setting indicates that the query is a write and should be directed to a Primary. In Active-Active setups, where multiple Primaries exist, affinity determines in which site the primary should be selected.


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


    The RW_SESSION QoS is specific to Smartscale Routing, and should not be used outside of its scope unless directed by Continuent Support.

These hints for the connection can be set, for example through the URL database name, by using the value in the comments during SQL routing, or globally in host based routing. See Section 7.4.11, “SQL Routing” for more information on SQL routing or Section 7.4.12, “Host-based Routing” for Host based routing specifics.

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 Host Options (See Section 7.4.12, “Host-based Routing”), or through configuration.

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

SmartScale QoS Primary Selected Replica Selected
Disabled RW_STRICT Yes, always No.
Enabled RW_SESSION (Set automatically) Yes, for writes Yes, for reads (if below max applied latency).
Disabled RO_RELAXED Only if no Replica available Yes, if below max applied latency.