Google Professional Cloud Database Engineer Question 218
Select 3Google Cloud PlatformYou have configured a Google Cloud SQL PostgreSQL database with replication from an on-premises PostgreSQL database using Cloud SQL's external primary instance feature. Now, your team requires reverse replication to occur, where changes made in the Cloud SQL instance are pushed back to the on-premises PostgreSQL database. What steps should you take to enable this reverse replication?
- A
Enable logical replication in the Cloud SQL instance and configure a publication for the desired tables.
- B
Set up a read replica of the Cloud SQL instance in the on-premises PostgreSQL database.
- C
Configure the on-premises PostgreSQL database as a subscriber to the Cloud SQL publication.
- D
Use Google Cloud's Database Migration Service to establish reverse replication.
- E
Ensure network connectivity and firewall rules allow the Cloud SQL instance to communicate with the on-premises database.
Show answer and explanation
Correct answers: A, C, E
Explanation
To enable reverse replication from a Cloud SQL instance to an on-premises PostgreSQL database, logical replication must be configured. This involves enabling logical replication on the Cloud SQL instance, creating a publication for the desired tables, and setting up the on-premises database as a subscriber to the publication. Additionally, proper network connectivity and firewall rules must be in place to allow communication between the Cloud SQL instance and the on-premises database.
- A. Correct.
Correct. Logical replication must be enabled on the Cloud SQL instance, and a publication must be created to define the specific tables whose changes need to be replicated.
- B. Incorrect.
Incorrect. Setting up a read replica is not applicable in this scenario since read replicas only replicate data in one direction (source to replica) and do not allow reverse replication.
- C. Correct.
Correct. The on-premises PostgreSQL database must be configured as a subscriber to the publication created in the Cloud SQL instance to receive changes.
- D. Incorrect.
Incorrect. Google Cloud's Database Migration Service is designed for one-time migrations or continuous replication for migration purposes, not for setting up reverse replication in this context.
- E. Correct.
Correct. Network connectivity and firewall rules are essential to ensure that the Cloud SQL instance can communicate with the on-premises PostgreSQL database for replication.