Google Professional Cloud Developer Question 188
Single answerGoogle Cloud PlatformYou are designing a new application on Google Cloud that requires high performance for querying user data based on frequently accessed attributes, such as email address and user ID. The application also requires scalability to handle millions of users and low latency for both read and write operations. Which storage and data access pattern should you choose?
- A
Use Cloud SQL with a primary index on the user ID and secondary indexes on frequently queried attributes.
- B
Use Cloud Spanner with a single table and distribute the data based on user ID to ensure scalability.
- C
Use Firestore in Datastore mode with entity groups and queries optimized for frequently accessed attributes.
- D
Use Bigtable with a schema designed to use row keys based on frequently queried attributes like email address or user ID.
Show answer and explanation
Correct answer: D
Explanation
Bigtable is the most appropriate option for this scenario because it is specifically designed for low-latency, high-throughput workloads at scale. By designing row keys around frequently queried attributes, such as email addresses or user IDs, you can ensure fast and efficient data access. Other options, while valid for certain use cases, do not meet all the requirements for scalability and performance in this specific scenario.
- A. Incorrect.
While Cloud SQL supports indexing and relational queries, it may not scale effectively for millions of users with low latency requirements due to its nature as a relational database.
- B. Incorrect.
Cloud Spanner is a good option for global scalability and consistency; however, it may not provide the optimal performance for use cases requiring low-latency access for individual attributes like email addresses.
- C. Incorrect.
Firestore in Datastore mode supports scalable querying but is better suited for hierarchical or document-based data access patterns, not for use cases requiring high-performance querying on specific attributes.
- D. Correct.
Bigtable is a highly scalable NoSQL database optimized for low-latency, high-throughput access. Designing row keys based on frequently queried attributes like email addresses or user IDs ensures efficient queries and supports the application's scalability and performance requirements.