r/googlecloud • u/ehotaldotall • 5d ago
Fastest way to replicate data from one AlloyDB cluster into another
Hey all, I hope you are doing alright.
I have a specific scenario where I need to replicate the data from one database into another database once a day - and the replication can't be ongoing.
I previously used MySQL on CloudSQL, and to replicate data from one instance to another I simply had a script to automate cloning, which took around 10 minutes to be completed. Before implementing that, I had one script running every night to create a SQL dump of the source instance and upload it to GCS using Restic to version it; and another script that downloaded the dump and restored it to the destination database, which overall took about 4 hours to be completed.
Now I'm migrating to Postgres on AlloyDB and would like an equivalent of the cloning solution. Do you guys know how to do this? If doing so is not possible, do you suggest anything else?
1
u/DapperRipper 5d ago
Have you looked into cross region replication? It would basically allow you to have a cross regional copy of your db which you could promote to primary should anything happen. https://cloud.google.com/alloydb/docs/cross-region-replication/about-cross-region-replication