Reputation: 6504
I have a MySQL database called latest
, and another database called previous
, both running on the same server. Both databases have identical content. Once per day, an application runs that updates latest
. Later on, towards the end of the applications execution, a comparison is made between latest
and previous
for certain data. Differences that are found, if any, will trigger certain actions e.g. notification emails to sent. After that, a copy of latest
is dumped to a file using mysqldump
and restored to previous
. Both databases are now in sync again and the process repeats the following day.
I would like to migrate the database(s) to AWS RDS. I'm open to using Aurora, but the MySQL engine is fine too. Is there a simpler or more efficient way of performing the restore process so that both databases are in sync using RDS? A way that avoids having to use mysqldump
and feeding the result into previous
?
I understand that I could create a read replica of an instance running latest
to act as previous
, but I think that updates the read replica as the source DB is updated (well, asynchronously anyway) which would ruin the possibility of performing a comparison between the two later on.
I don't have any particular problem with using mysqldump
for the restore process, but I'm just not sure If I'm missing a trick.
Upvotes: 0
Views: 223
Reputation: 2511
If you don't want a read replica, your option using mysqldump is good but probably you could use it with mysqlimport as suggested in the MySQL Docs:
Copying MySQL Databases to Another Machine
You can also use mysqldump and mysqlimport to transfer the database. For large tables, this is much faster than simply using mysqldump.
Upvotes: 1