Routing Statements with MaxScale's Read/Write Split Router

Overview

The Read/Write Split Router (readwritesplit) uses well-defined rules to determine whether a statement can be routed to a replica server, or whether it needs to be routed to the primary server. Application designers must understand these rules to ensure that the router can properly load balance queries.

Statements Routed to the Primary Server

The following statements are routed to the primary server:

Statements Routed to a Replica Server

The following statements are routed to a replica server:

Statements Routed to All Servers

The following statements are routed to all servers:

  • SETSET statements, including those embedded in read-only statements

  • USEUSE statements

  • PREPAREPREPARE statements that create prepared statements

  • Internal client commands, such as QUIT, PING, STMT RESET, and CHANGE USER.