Using MYSQL replication to speed up Schema changes and table optermise -
i hear many people use master - slave arrangements improve time taken when changing schemas using replication setup new temporary master, stopping relocation , swapping roles before starting again. have found example (below) found on stack overflow.
- setup slave
- stop replication.
- make alter on slave
- let slave catch master
- swap master , slave, slave becomes production server changed structure , minimum downtime
this well, however, dont understand step 4 isn't clear me.
i wonder if please explain procedure clearer.
let slave catch master
let slave catch master meaning slave 0 seconds behind master.
this mean if replication stopped @ point (for alter table),
register last replication time.
when replication resume,
compare current write on master last replication time on slave.
however, procedures seems flaw.
cannot alter slave and
expecting schema in updated slave same master.
in events column type changed, column dropped,
potentially lead replication failure.
Comments
Post a Comment