Load balancing read transactions

Having a single slave to switch it to master in case of problems is a good solution for high availability. However, if you need an intensive read across your database and have already optimized all the things you could do, then the solution is to build additional slaves.

The goal here is to distribute the traffic across multiple slaves for the read access and only write to the MariaDB instance that will then replicate to the slaves. Let's call this the read-only group of MariaDB: read group.

Your application should be able to split by itself the read and write requests. So, we can use DNS round robin for load balance against the read MariaDB instances, as this is the simplest method. However, the danger of that mechanism ...

Get MariaDB High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.