In the age of jetsetting and space travel and ORMs and such, MySQL DBAs are the least sophisticated ones nowadays, usually fighting terabytes or petabytes of data with army of shell scripts – as there’re no nice frameworks to explain what you want to do in MySQL administration. The nice thing about proper object frameworks is that they allow to concentrate on the work and logic done, allowing to think on the process done, rather on languages/APIs/etc.
For example, moving a slave to another master down a replication topology could be expressed this way (this is a working code, actually):
slave = mysql(options.slave) oldmaster = mysql(slave.get_master()) newmaster = mysql(options.newmaster) oldmaster.lock() oldpos = oldmaster.pos() newmaster.wait(oldpos) newmaster.lock() oldmaster.unlock() slave.wait(oldpos) slave.change_master(newmaster) newmaster.unlock()
I’m sure transaction group/global IDs would simplify the process …
[Read more]