Google Professional Cloud Database Engineer Question 159
Select 2Google Cloud PlatformYour team is managing a Cloud SQL for PostgreSQL instance that has recently experienced a spike in usage, leading to higher costs and degraded performance. Which actions should you take to optimize both the cost and performance of the database?
- A
Enable query insights to identify and optimize slow queries.
- B
Scale up the instance to a larger machine type to handle increased traffic.
- C
Enable automatic storage increases to ensure the database doesn't run out of space.
- D
Implement a read replica to offload read-heavy traffic.
- E
Disable backups to save storage costs.
Show answer and explanation
Correct answers: A, D
Explanation
To optimize cost and performance, it is essential to address the root causes of inefficiency, such as poorly performing queries, and to appropriately distribute database traffic. Enabling query insights provides actionable insights for query optimization, while implementing a read replica helps distribute load, improving both performance and cost efficiency. Scaling up or disabling backups may address certain issues but are not optimal solutions for cost and performance optimization.
- A. Correct.
Enabling query insights helps identify inefficient queries that may be consuming excessive resources. Optimizing these queries can improve performance and reduce costs.
- B. Incorrect.
Scaling up the instance increases compute power but also raises costs. While this may improve performance temporarily, it is not the most cost-efficient optimization strategy.
- C. Incorrect.
Automatic storage increases prevent the database from running out of space, but they don't directly address performance or cost optimization.
- D. Correct.
Implementing a read replica can offload read-heavy traffic from the primary instance, improving performance and potentially reducing costs by distributing the load.
- E. Incorrect.
Disabling backups may save on storage costs but introduces a significant risk of data loss and is not considered a best practice for cost optimization.