Mysql – load balancing MySql servers

load balancingMySQL

I heard from a guy who works at a hosting company that you cannot load balance mysql servers. Is that true?

As a side question, what should i do programmatically to handle these downtimes?

Best Answer

At a very simplistic, Kindergartner level, he's right -- you can't just stick a layer 4 load balancer in front of a bunch of MySQL servers and expect it to work, like you would with a bunch of web servers.

However, there are techniques for spreading the load amongst a number of MySQL servers, such as sharding and multimaster replication, and in that sense the guy you were speaking to is dead wrong.

As far as "these downtimes", I'm not sure what you mean -- load balancing isn't (necessarily) high-availability, and it's important to understand the relationship and differences between the two if you want to use these techniques properly.

In general, you handle the downtime of your storage layer by presenting an apologetic sorry page to users and then screaming for help behind the scenes from the on-call sysadmin.

Related Topic