I currently have one Cloud SQL instance (PostgreSQL) in my Google Account, but I want to create a staging database so I can perform some tests before making schema changes to the prod Cloud SQL database.
The prod database automatically receives data from different data sources by some simple ETL processes and I don't want to replicate these data loads on the staging database. These automated processes should not run in staging because they are unecessary for testing purposes most of the time. I also don't want to create a staging database as big as the prod.
Considering what I've talked above and that I don't use different projects for setting up staging/prod environments, I have a few questions to make:
I've realized there is a feature of cloning databases in GCP. I've never used it, but I wonder if it is a good practice to clone my prod database from time to time to create my staging database, since doing backups and restores can be a pain.
Can I use the cloning feature in a logical fashion (select only some tables to clone, etc.)? Or does it rely entirely on physical backups?
I imagine cloning a huge database might take a few hours, so I'm wondering if there is a way to apply only the diff between the two databases, so I don't have to clone the whole database every time, similar to a replication approach?
If I use separate projects for dev/test/prod. What are the available approaches for synchronizing the different database environments?