PROFESSIONAL-CLOUD-DATABASE-ENGINEER · Question #5
You are running a mission-critical application on a Cloud SQL for PostgreSQL database with a multi-zonal setup. The primary and read replica instances are in the same region but in different zones…
The correct answer is A. Use Cloud Load Balancing for load balancing between the Cloud SQL primary and read replica. Cloud Load Balancing (specifically Internal TCP/UDP Load Balancing) can distribute database connections across both the primary and read replica instances at the network layer, enabling load splitting between the two. This is the appropriate mechanism for distributing traffic…
Question
You are running a mission-critical application on a Cloud SQL for PostgreSQL database with a multi-zonal setup. The primary and read replica instances are in the same region but in different zones. You need to ensure that you split the application load between both instances. What should you do?
Options
- AUse Cloud Load Balancing for load balancing between the Cloud SQL primary and read replica
- BUse PgBouncer to set up database connection pooling between the Cloud SQL primary and read
- CUse HTTP(S) Load Balancing for database connection pooling between the Cloud SQL primary
- DUse the Cloud SQL Auth proxy for database connection pooling between the Cloud SQL primary
How the community answered
(36 responses)- A75% (27)
- B8% (3)
- C3% (1)
- D14% (5)
Explanation
Cloud Load Balancing (specifically Internal TCP/UDP Load Balancing) can distribute database connections across both the primary and read replica instances at the network layer, enabling load splitting between the two. This is the appropriate mechanism for distributing traffic across multiple Cloud SQL endpoints. PgBouncer (B) is a connection pooler, not a load balancer, and does not natively route traffic between a primary and its replica. HTTP(S) Load Balancing (C) operates at Layer 7 and is not suitable for raw TCP database connections. The Cloud SQL Auth Proxy (D) provides secure, IAM-authenticated connectivity to a single instance but does not perform load balancing between multiple instances.
Topics
Community Discussion
No community discussion yet for this question.