# Understanding MaxScale's Read/Write Split Router

MaxScale's [Read/Write Split Router (readwritesplit)](https://mariadb.com/docs/maxscale/reference/maxscale-routers/maxscale-readwritesplit) performs query-based load balancing. For each client connected to MaxScale, it opens up connections to multiple back-end database servers. When the client sends a write query to MaxScale, it routes the query to the connection opened with the primary server. When the client sends a read query to MaxScale, it routes the query to a connection opened with one of the replicas.

## What Does the Read/Write Split Router Support?

The [Read/Write Split Router (readwritesplit)](https://mariadb.com/docs/maxscale/reference/maxscale-routers/maxscale-readwritesplit) supports:

* [MariaDB replication](https://github.com/mariadb-corporation/mariadb-docs/blob/main/server/architecture/topologies/primary-replica/README.md) deployments.
* [Galera Cluster](https://github.com/mariadb-corporation/mariadb-docs/blob/main/server/architecture/topologies/galera-cluster/README.md) deployments.
* [Columnstore Object Storage](https://github.com/mariadb-corporation/mariadb-docs/blob/main/server/architecture/topologies/columnstore-object-storage/README.md) and [ColumnStore Shared Local Storage](https://github.com/mariadb-corporation/mariadb-docs/blob/main/server/architecture/topologies/columnstore-shared-local-storage/README.md) deployments.

## When to Use the Read/Write Split Router?

The [Read/Write Split Router (readwritesplit)](https://mariadb.com/docs/maxscale/reference/maxscale-routers/maxscale-readwritesplit) allows you to:

* Perform query-based load balancing.
* Route client connections to multiple servers simultaneously.
* Route write queries to primary and read queries to replicas.
* Automatically reconnect clients to the new primary after failover or switchover.
* Automatically replay transactions on the new primary after failover or switchover.
* Automatically retry failed queries.
* Enforce causal reads to avoid reading stale data caused by slave lag.

<sub>*This page is: Copyright © 2025 MariaDB. All rights reserved.*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/maxscale/maxscale-use-cases/readwrite-split-router-usage/understanding-maxscales-readwrite-split-router.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
