> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/maxscale/maxscale-use-cases/readwrite-split-router-usage/designing-for-maxscales-readwrite-split-router.md).

# Designing for MaxScale's Read/Write Split Router

[MaxScale's Read/Write Split Router (readwritesplit)](/docs/maxscale/reference/maxscale-routers/maxscale-readwritesplit.md) 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.

This page contains topics that need to be considered when designing applications that use the Read/Write Split Router.

* How does the [Read/Write Split Router route queries?](/docs/maxscale/maxscale-use-cases/readwrite-split-router-usage/routing-statements-with-maxscales-readwrite-split-router.md)
* How does the [Read/Write Split Router select replica servers to load balance queries?](/docs/maxscale/maxscale-use-cases/readwrite-split-router-usage/selecting-replica-servers-with-maxscales-readwrite-split-router.md)
* How does the [Write Split Router reconnect client connections to the new primary server after automatic failover?](/docs/maxscale/maxscale-use-cases/readwrite-split-router-usage/reconnecting-to-the-primary-server-with-maxscales-readwrite-split-router.md)
* How does the [Read/Write Split Router retry failed reads?](/docs/maxscale/maxscale-use-cases/readwrite-split-router-usage/retrying-failed-reads-with-maxscales-readwrite-split-router.md)
* How does the [Read/Write Split Router retry failed queries during automatic failover?](/docs/maxscale/maxscale-use-cases/readwrite-split-router-usage/delayed-retrying-of-failed-queries-with-maxscales-readwrite-split-router.md)

Additional information is available [here](/docs/maxscale/reference/maxscale-routers/maxscale-readwritesplit.md)

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

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
