Google Professional Cloud Database Engineer Question 248
Single answerGoogle Cloud PlatformYou are designing a multi-regional database solution for a global e-commerce platform using Cloud Spanner. The platform requires low-latency reads and writes across multiple geographic locations while ensuring strong consistency and high availability. Which configuration should you choose to achieve this?
- A
Configure a single-region instance with read replicas in other regions.
- B
Set up a multi-region instance with regional replicas in the desired geographic locations.
- C
Use Cloud SQL with cross-region read replicas for better availability.
- D
Create multiple single-region Cloud Spanner instances and synchronize them using a custom application.
Show answer and explanation
Correct answer: B
Explanation
To achieve low-latency reads and writes across multiple regions with strong consistency, you should configure a multi-region instance in Cloud Spanner. Cloud Spanner's multi-region configuration ensures global availability and strong consistency by using regional replicas and Google's underlying infrastructure, making it the best choice for this scenario.
- A. Incorrect.
A single-region instance with read replicas does not provide low-latency writes in multiple regions. Additionally, read replicas are read-only and do not ensure strong consistency across regions.
- B. Correct.
A multi-region instance with regional replicas in Cloud Spanner is specifically designed for low-latency reads and writes across multiple geographic locations while maintaining strong consistency and high availability. This is the correct approach.
- C. Incorrect.
Cloud SQL with cross-region read replicas supports read scalability, but it does not allow for low-latency writes or strong consistency across regions. It is not suitable for this use case.
- D. Incorrect.
Synchronizing multiple single-region Cloud Spanner instances manually introduces complexity, does not ensure strong consistency, and is not recommended for global applications with stringent latency requirements.