Google Professional Cloud Database Engineer Question 161
Select 2Google Cloud PlatformYour organization uses Cloud SQL for its production workloads. Recently, your team has noticed increasing costs associated with the database instance while performance remains suboptimal during peak hours. As a Professional Cloud Database Engineer, which actions should you take to optimize both cost and performance?
- A
Enable automatic storage increases to ensure the database never runs out of space.
- B
Analyze query performance using the Query Insights tool and optimize slow-running queries.
- C
Scale the Cloud SQL instance to a higher machine type with more CPU and memory.
- D
Implement a read replica to distribute read-intensive workloads and reduce load on the primary instance.
- E
Enable high availability (HA) to improve write throughput and reduce latency.
Show answer and explanation
Correct answers: B, D
Explanation
To optimize cost and performance in Cloud SQL, it’s important to focus on analyzing and improving query efficiency using Query Insights and redistributing load using read replicas. These strategies can improve performance while keeping costs under control. Scaling the instance or enabling HA may improve performance but could lead to increased costs, which is not aligned with the optimization goal.
- A. Incorrect.
While enabling automatic storage increases ensures the database does not run out of space, it does not directly address cost and performance optimization. This feature is primarily for avoiding outages due to insufficient storage.
- B. Correct.
Query Insights provides detailed analysis of query performance, helping identify and optimize slow-running queries. Optimized queries can significantly improve performance without increasing costs.
- C. Incorrect.
Scaling to a higher machine type can improve performance but will also increase costs. This action does not align with the goal of optimizing both cost and performance.
- D. Correct.
Implementing a read replica can offload read-intensive workloads from the primary instance, improving performance and potentially reducing costs if the primary instance can be scaled down.
- E. Incorrect.
Enabling high availability (HA) improves fault tolerance and system reliability but does not directly optimize cost or performance. It may even increase costs due to additional resources required for replication.