Google Professional Cloud Database Engineer Question 42
Select 3Google Cloud PlatformYou are designing a GCP-based solution for a web application that requires secure and highly available connections to a Cloud SQL database. The application needs to handle dynamic scaling and must maintain minimal latency. Which approaches should you implement to allow the application to connect to the database effectively?
- A
Use the Cloud SQL Auth Proxy to handle secure connections between the application and the database.
- B
Configure a private IP for the Cloud SQL instance and ensure the application is running in the same VPC.
- C
Allow direct public IP access to the database and restrict access using a strong database username and password.
- D
Implement a connection pooler such as PgBouncer to optimize database connections from the application.
- E
Enable Cloud SQL Insights to automatically adjust database connections based on application traffic.
Show answer and explanation
Correct answers: A, B, D
Explanation
To ensure secure, low-latency, and scalable connections to Cloud SQL, it is recommended to use the Cloud SQL Auth Proxy for secure communication, configure private IP for low-latency VPC-level connectivity, and implement a connection pooler to handle high traffic scenarios efficiently. Public IP access is discouraged due to security risks, and Cloud SQL Insights is unrelated to connection management.
- A. Correct.
The Cloud SQL Auth Proxy is a best practice for securely connecting to Cloud SQL databases, as it handles authentication and encryption.
- B. Correct.
Using a private IP ensures low-latency connections within the same VPC and improves security by avoiding public internet access.
- C. Incorrect.
Allowing direct public IP access even with strong credentials is not recommended due to potential security vulnerabilities.
- D. Correct.
A connection pooler like PgBouncer helps manage database connections efficiently, especially in dynamic scaling scenarios.
- E. Incorrect.
Cloud SQL Insights is a monitoring tool for query performance and does not adjust database connections dynamically.