Google Professional Cloud Database Engineer Question 215
Select 3Google Cloud PlatformYour company is running a hybrid cloud architecture with a PostgreSQL database on-premises and a Cloud SQL for PostgreSQL instance in Google Cloud. You have configured a one-way replication from the on-premises database to Cloud SQL using Cloud SQL's external replica feature. A new requirement has arisen to enable reverse replication from Cloud SQL back to the on-premises PostgreSQL database. Which of the following steps should you take to enable reverse replication?
- A
Configure logical replication on the Cloud SQL instance to allow publishing changes to the on-premises database.
- B
Set up a VPN or Interconnect to establish a secure connection between the Cloud SQL instance and the on-premises database.
- C
Enable binary log replication on the on-premises PostgreSQL database to accept changes from Cloud SQL.
- D
Install a replication tool like pglogical on the on-premises PostgreSQL database to apply changes received from Cloud SQL.
- E
Directly enable reverse replication in the Cloud SQL console by toggling the 'Reverse Replication' setting.
Show answer and explanation
Correct answers: A, B, D
Explanation
To enable reverse replication from Cloud SQL to an on-premises PostgreSQL database, you need to set up logical replication on the Cloud SQL instance to publish changes. A secure network connection between the Cloud SQL instance and the on-premises database is also essential. Additionally, a replication tool such as pglogical must be installed on the on-premises database to consume and apply the changes. Binary log replication is irrelevant in this case, and there is no direct option in the Cloud SQL console to toggle reverse replication.
- A. Correct.
Correct. Logical replication must be configured on Cloud SQL to publish changes that can be consumed by the on-premises database.
- B. Correct.
Correct. A secure network connection (e.g., VPN or Interconnect) is required for replication traffic between Cloud SQL and the on-premises database.
- C. Incorrect.
Incorrect. Binary log replication is not required in this scenario as reverse replication using logical replication does not rely on binary logs.
- D. Correct.
Correct. A tool like pglogical is needed on the on-premises PostgreSQL database to apply the logical replication changes coming from Cloud SQL.
- E. Incorrect.
Incorrect. There is no 'Reverse Replication' setting in the Cloud SQL console. Configuration must be done manually using logical replication and other tools.