Google Professional Cloud Database Engineer Question 19
Single answerGoogle Cloud PlatformYour organization is building a cloud-based e-commerce platform that experiences variable workloads, including high traffic during sales events. The database must handle up to 50,000 concurrent users during peak times while maintaining low latency and high availability. Which configuration should you choose to ensure the database compute and storage are appropriately sized?
- A
Use Cloud SQL with a single read replica and 8 vCPUs, 64 GB of memory, and standard SSD storage.
- B
Use Cloud Spanner with 5 nodes and configure autoscaling for both compute and storage.
- C
Use Firestore in Native mode with no additional configuration, as it automatically scales.
- D
Use a self-managed PostgreSQL instance on Compute Engine with 8 vCPUs, 32 GB of memory, and local SSDs.
Show answer and explanation
Correct answer: B
Explanation
Cloud Spanner is the best choice for this scenario as it is specifically designed to handle high volumes of traffic, maintain low latency, and provide high availability. Its ability to scale horizontally and support strong consistency makes it ideal for an e-commerce platform experiencing variable workloads and peak traffic events. The other options either lack the scalability, availability, or performance required for the described scenario.
- A. Incorrect.
While Cloud SQL supports read replicas and offers decent scalability, it is not ideal for handling extremely high workloads like 50,000 concurrent users, especially during peak events. The provided configuration may result in performance bottlenecks under such traffic.
- B. Correct.
Cloud Spanner is a horizontally scalable, globally distributed database that can handle high workloads and traffic spikes. With 5 nodes and autoscaling, it can meet the performance and availability requirements of the e-commerce platform during sales events.
- C. Incorrect.
Firestore in Native mode is designed for specific use cases like document-based applications but may not be suitable for handling complex relational data or the high concurrent users of an e-commerce platform. While it scales automatically, it doesn't align with the transactional consistency and structured relational workloads described.
- D. Incorrect.
While a self-managed PostgreSQL instance on Compute Engine provides flexibility, it lacks the ability to automatically scale compute and storage based on workload changes. The provided configuration is insufficient to handle 50,000 concurrent users during peak times.