Google Professional Cloud Database Engineer Question 163
Select 2Google Cloud PlatformYour company is running a Cloud SQL for PostgreSQL instance for its e-commerce application. The database workload experiences periodic high spikes in traffic during sales campaigns, leading to performance degradation. The team also noticed unexpected costs due to idle resources during non-peak times. How can you optimize both the cost and performance of the database?
- A
Enable Cloud SQL automatic storage increase to handle peak traffic.
- B
Switch to a high-availability (HA) configuration to improve performance during spikes.
- C
Configure Cloud SQL instance to use committed use discounts for predictable workloads.
- D
Utilize Cloud SQL's autoscaling feature to dynamically scale up and down based on traffic.
- E
Leverage a read replica to offload read traffic during peak periods.
Show answer and explanation
Correct answers: C, E
Explanation
To optimize cost and performance in this scenario, leveraging committed use discounts can reduce predictable costs, and using read replicas can handle performance spikes during peak times by offloading read-heavy workloads. Other options, such as automatic storage increase, HA configuration, or autoscaling, do not address the specific problem or are not supported by Cloud SQL.
- A. Incorrect.
Enabling automatic storage increase ensures the database does not run out of storage but does not address performance spikes or cost optimization directly.
- B. Incorrect.
High-availability (HA) configurations improve fault tolerance and availability but do not optimize cost or handle performance during traffic spikes.
- C. Correct.
Committed use discounts can reduce costs for predictable workloads by committing to a specific usage level, making it a relevant option for cost optimization.
- D. Incorrect.
Cloud SQL currently does not support autoscaling for instances; scaling must be done manually or by pre-configuring instance resize.
- E. Correct.
Using read replicas can offload read-heavy tasks during peak periods, improving performance without scaling the primary instance significantly, which helps control costs.