
Answer-first summary for fast verification
Answer: Use PgBouncer to set up database connection pooling between the Cloud SQL primary and read replica instances.
To split the application load between the primary and read replica instances of a Cloud SQL for PostgreSQL database in a multi-zonal setup, the correct approach is to use PgBouncer for setting up database connection pooling. PgBouncer is a lightweight connection pooler for PostgreSQL that can efficiently manage connections to both the primary and read replica instances, thereby distributing the load. Option A, using Cloud Load Balancing, is incorrect because Cloud Load Balancing is designed for distributing HTTP(S) traffic and not database connections. Option C, using HTTP(S) Load Balancing, is also incorrect for the same reason as it's not suitable for database connection pooling. Option D, using the Cloud SQL Auth proxy, is incorrect because while it provides secure access to your Cloud SQL instances, it does not offer connection pooling capabilities.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can you distribute the application load between the primary instance and a read replica in a multi-zonal Cloud SQL for PostgreSQL setup within the same region?
A
Use Cloud Load Balancing for load balancing between the Cloud SQL primary and read replica instances.
B
Use PgBouncer to set up database connection pooling between the Cloud SQL primary and read replica instances.
C
Use HTTP(S) Load Balancing for database connection pooling between the Cloud SQL primary and read replica instances.
D
Use the Cloud SQL Auth proxy for database connection pooling between the Cloud SQL primary and read replica instances.
No comments yet.