Skip to content

Instantly share code, notes, and snippets.

@dbolser-ebi
Last active January 22, 2016 10:07
Show Gist options
  • Save dbolser-ebi/7f7b90588e3560786b64 to your computer and use it in GitHub Desktop.
Save dbolser-ebi/7f7b90588e3560786b64 to your computer and use it in GitHub Desktop.
Outline of a project to manage a set of database schema across multiple MySQL instances using Percona
We have 2 'staging' databases that we use to prepare alternating
releases of our data. One staging machine is a copy of what's
currently 'live' and the other is the place where the next
release is prepared (pre-live if you like).
We have 3 'production' databases where DB heavy processes are run
in preparation for putting a database onto 'pre-live'.
We have 3 'development' databases where we run ad-hock analysis.
During production and development, there is a lot of copying
schema (including data) between the different servers.
Using Percona's 'pt-table-sync' in 'dry-run' mode it's possible
to track all the table level differences between 'the same'
schema on all 9 servers.
I'd like to dry-run pt-table-sync nightly on all databases on all
servers, store the results and present them in a web GUI at both
summary and detailed levels (e.g. 3 tables differ between schema
x on server A and B, 2 are newer on B and one is newer on A,
etc.)
The user could then click on the summery to drill down into the
details (e.g. table p has 10 INSERTs, 100 UPDATEs and 2 DELETEs
on server A relative to server B) and could then click a 'sync'
button to automatically fire off the pt-table-sync process and
update the database, optionally choosing to update a specific
list of tables, optionally choosing to perform only one type of
update (e.g. INSERTs but not DELETEs).
Additional features would be to copy a selection of databases
from one server to another, delete a set of databases, backup a
set of databases, etc., etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment