Google Professional Cloud Database Engineer Question 234
Single answerGoogle Cloud PlatformYou are tasked with designing a high-availability solution for a MySQL database on Google Cloud. The database must be capable of automatically failing over to a standby instance in case of a primary instance failure, with minimal downtime. Which solution would best meet this requirement?
- A
Deploy MySQL on a Compute Engine instance and use a startup script to restart the database in case of failure.
- B
Use Cloud SQL with high availability enabled and configure a regional failover replica.
- C
Deploy MySQL on a Kubernetes cluster and manage failover using Kubernetes StatefulSets.
- D
Use Memorystore for Redis as a replacement for the MySQL database to achieve high availability.
Show answer and explanation
Correct answer: B
Explanation
The best solution for provisioning a high-availability MySQL database in Google Cloud is to use Cloud SQL with high availability enabled. This configuration includes a primary instance and a standby instance in different zones within the same region. It ensures automatic failover in case of a primary instance failure, minimizing downtime and meeting the requirements for high availability.
- A. Incorrect.
While Compute Engine can host MySQL, simply using a startup script does not provide automated failover capabilities or meet the requirements for high availability.
- B. Correct.
Cloud SQL with high availability enabled automatically creates a standby instance in a different zone within the same region. It also provides built-in failover capabilities to minimize downtime, making it the best option for this scenario.
- C. Incorrect.
Kubernetes StatefulSets are not inherently designed to manage database failover, and using them for MySQL would require significant custom implementation to handle high availability and failover scenarios.
- D. Incorrect.
Memorystore for Redis is an in-memory data store and is not a direct replacement for MySQL. It is unsuitable for relational database workloads and would not meet the requirements of this scenario.