pac-aurora-synchroniser
A CLI tool to synchronise the latest PAC data between two Aurora instances
Introduction
This CLI tool aims to synchronize two AWS aurora instances used for PAC.
The software moves all the records that are more recent in a source database to a target database
based on the last_modified
field of each table.
Tables without such field will be ignored by the synchronisation process.
Installation
Download the source code, dependencies and test dependencies:
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
mkdir $GOPATH/src/github.com/Financial-Times/public-things-api
cd $GOPATH/src/github.com/Financial-Times
git clone https://github.com/Financial-Times/public-things-api.git
cd public-things-api && dep ensure -vendor-only
go build .
Running locally
-
Run the tests and install the binary:
go test ./...
go install
-
Run the binary (using the help
flag to see the available optional arguments):
$GOPATH/bin/pac-aurora-synchroniser [--help]
Options:
--source-db-connection-url Connection URL to the database with the most recent data (env $SOURCE_DB_CONNECTION_URL)
--target-db-connection-url Connection URL to the database that needs to receive the latest data (env $TARGET_DB_CONNECTION_URL)