Google Professional Cloud Database Engineer Question 13
Select 2Google Cloud PlatformYour company runs an e-commerce platform hosted on Google Cloud, and the backend uses a Cloud SQL for PostgreSQL database. The platform experiences high read traffic during flash sales, which causes performance issues. You are tasked with optimizing performance and cost. Which configuration changes would be most effective in addressing the performance issues while considering cost tradeoffs?
- A
Upgrade the Cloud SQL instance to a larger machine type with more CPU and memory.
- B
Switch the database storage from SSD to HDD to lower storage costs.
- C
Enable read replicas to distribute read traffic across multiple instances.
- D
Reduce the database instance tier to save on compute costs.
- E
Change the disk auto-scaling setting to allow the database to grow storage capacity as needed.
Show answer and explanation
Correct answers: A, C
Explanation
The best approach to handle high read traffic is to upgrade to a larger machine type for better performance and enable read replicas to distribute the read workload. These changes involve a tradeoff between additional costs and improved performance. Other options, such as switching to HDD or reducing the instance tier, may save costs but will negatively impact performance, making them unsuitable for this scenario.
- A. Correct.
Upgrading to a larger machine type with more CPU and memory can improve database performance during high traffic periods, but it increases costs. This is a valid tradeoff for better performance.
- B. Incorrect.
Switching to HDD may reduce storage costs, but it will degrade performance, especially for read-heavy workloads, as HDDs have lower IOPS and higher latency compared to SSDs.
- C. Correct.
Enabling read replicas can offload read traffic from the primary instance, improving performance for read-heavy workloads. It incurs additional costs for the replica instances but is an effective way to handle high read traffic.
- D. Incorrect.
Reducing the database instance tier decreases costs but will worsen performance, especially during high traffic periods. This is not a suitable solution in this scenario.
- E. Incorrect.
Changing the disk auto-scaling setting helps manage storage growth dynamically but does not directly address performance issues caused by high read traffic during flash sales.