Bird
0
0

You want to run Cloud SQL Proxy on a Compute Engine VM to allow multiple apps to connect securely to your Cloud SQL instance. Which approach is best to ensure secure and scalable connections?

hard📝 Best Practice Q15 of 15
GCP - Cloud SQL and Databases
You want to run Cloud SQL Proxy on a Compute Engine VM to allow multiple apps to connect securely to your Cloud SQL instance. Which approach is best to ensure secure and scalable connections?
AConnect apps directly to Cloud SQL IP with SSL certificates, skipping the proxy
BRun separate Cloud SQL Proxy instances per app on different ports on the VM
CUse Cloud SQL Proxy only locally on developer machines, not on VMs
DRun one Cloud SQL Proxy instance on the VM, listening on a shared port, and configure apps to connect to localhost
Step-by-Step Solution
Solution:
  1. Step 1: Understand proxy usage on shared VM

    Running a single proxy instance on the VM listening on one port allows multiple apps to connect securely via localhost, simplifying management.
  2. Step 2: Evaluate alternatives

    Run separate Cloud SQL Proxy instances per app on different ports on the VM adds complexity with multiple proxies; Connect apps directly to Cloud SQL IP with SSL certificates, skipping the proxy exposes IP and requires SSL setup; Use Cloud SQL Proxy only locally on developer machines, not on VMs limits proxy use unnecessarily.
  3. Final Answer:

    Run one Cloud SQL Proxy instance on the VM, listening on a shared port, and configure apps to connect to localhost -> Option D
  4. Quick Check:

    Single proxy instance for multiple apps = best practice [OK]
Quick Trick: One proxy instance per VM, multiple apps connect locally [OK]
Common Mistakes:
  • Running multiple proxies causing port conflicts
  • Skipping proxy and exposing IPs
  • Limiting proxy use to local machines only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes