Google Professional Cloud Database Engineer Question 58
Select 2Google Cloud PlatformYour team is experiencing performance issues with a PostgreSQL database hosted on Cloud SQL due to a high number of concurrent connections from multiple client applications. Which of the following justifies the use of a session pooler service, such as PgBouncer, to address this issue?
- A
It reduces the overhead of establishing and closing database connections.
- B
It balances the load across multiple database replicas in a Cloud SQL instance.
- C
It limits the number of active connections to prevent exhausting the database's connection limit.
- D
It improves query execution performance by rewriting inefficient SQL queries.
Show answer and explanation
Correct answers: A, C
Explanation
Session pooler services, such as PgBouncer, are designed to optimize database connection management by reusing connections and limiting the number of active connections. This reduces the overhead associated with opening and closing connections and ensures that the database does not exceed its connection limit. These features make session poolers particularly useful in high-concurrency scenarios, such as those experienced with Cloud SQL databases.
- A. Correct.
This is correct. A session pooler like PgBouncer reduces the overhead of connection management by reusing connections, which improves performance in high-concurrency environments.
- B. Incorrect.
This is incorrect. Session poolers do not handle load balancing across database replicas; this functionality is typically managed by database proxy tools or custom application logic.
- C. Correct.
This is correct. Session poolers can limit the number of active connections to avoid exceeding the database's connection limit, which can prevent resource exhaustion.
- D. Incorrect.
This is incorrect. Session poolers do not rewrite SQL queries; their primary function is to manage database connections efficiently.