Google Professional Cloud Database Engineer Question 175
Single answerGoogle Cloud PlatformYou are designing a multi-region database for an e-commerce application on Google Cloud. The database must ensure low-latency reads for users across different regions while maintaining eventual consistency. Which replication strategy should you choose?
- A
Synchronous replication with strong consistency
- B
Asynchronous replication with eventual consistency
- C
Multi-master replication with conflict resolution
- D
Single-region replication with read replicas
Show answer and explanation
Correct answer: B
Explanation
Asynchronous replication with eventual consistency is the most suitable replication strategy for a multi-region database when low-latency reads are required. This approach allows users in different regions to access data from the nearest replica, minimizing latency. Eventual consistency is acceptable for the use case, as it prioritizes performance over immediate consistency.
- A. Incorrect.
Synchronous replication with strong consistency ensures all replicas are updated immediately, but it introduces higher latency, especially in multi-region setups. This does not meet the low-latency requirement.
- B. Correct.
Asynchronous replication with eventual consistency allows replicas to be updated asynchronously, providing low-latency reads in different regions at the cost of eventual consistency. This is the best fit for the scenario.
- C. Incorrect.
Multi-master replication with conflict resolution allows multiple regions to accept writes, but it introduces complexity in resolving conflicts. The question specifies a need for low-latency reads, not multi-region writes.
- D. Incorrect.
Single-region replication with read replicas can improve read performance in a single region but does not effectively address the requirements of a multi-region setup.