MySQL Router 8.4  /  Deploying MySQL Router  /  Read/Write Splitting

3.5 Read/Write Splitting

MySQL Router supports Read-Write splitting. This configuration enables you to direct all read traffic to read-only instances, and all write traffic to read-write instances.

Read-write instances are primaries or sources. Read-only instances are secondaries in an InnoDB Cluster or the primary or secondary instances in a Replica Cluster.

MySQL Router classifies each query as read or write and directs it to the appropriate backend. It is also possible to manually, or programmatically, specify the type of query using ROUTER SET or query_attributes.

Note

Each client session can communicate with one read_write and one read_only destination.