Wednesday, 11 April 2012

Upcoming replication features in MySQL 5.6


The upcoming version of MySQL (5.6) has some neat features to simplify and automate the management of clusters of replicated databases (See [1]).

MySQL now provides utilities ([2]) to automatically detect the failure of a master database and automatically promote the most viable slave to take over. It is also easy to perform controlled switch over for maintenance purposes.

I had been wondering about writing a simple utility using Scala (because I quite like that language) and Zookeeper for creating self-healing clusters of replicated databases. In short, I was planning on doing the following:
  • Keep track of slaves statuses in Zookeeper. 
  • Detect a failure of the master database, either by detecting a failure of the node itself, or by detecting that the MySQL process is no longer running.
  • Handle fail-over to most up-to-date slave. This would use a custom ZK leader election algorithm.
  • Manage cluster virtual IP address. When the master DB changes, the machine on which it is running can acquire the Virtual IP address assigned to the DB cluster.
It seems that the MySQL Python-based tools will provide most of these functionalities out of the box. 

I am looking forward to trying out those new features. 


No comments:

Post a Comment