Google Professional Cloud Database Engineer Question 80
Single answerGoogle Cloud PlatformYour team is designing a database solution for a new e-commerce platform. The platform needs to store user profiles, which will include structured data such as usernames, email addresses, and hashed passwords. Additionally, the platform must efficiently handle an evolving product catalog where each product has unique attributes (e.g., color, size, material) that can vary widely across different product categories. Which database types should you choose for the user profiles and the product catalog, respectively?
- A
SQL for user profiles and SQL for the product catalog
- B
NoSQL for user profiles and NoSQL for the product catalog
- C
SQL for user profiles and NoSQL for the product catalog
- D
NoSQL for user profiles and SQL for the product catalog
Show answer and explanation
Correct answer: C
Explanation
The user profiles involve structured data that requires strong consistency and relational integrity, making SQL the optimal choice for this dataset. On the other hand, the product catalog involves semi-structured data with varying attributes, which is better served by a NoSQL database because of its schema flexibility and scalability. This combination ensures the most efficient and scalable solution for both use cases.
- A. Incorrect.
SQL for both use cases is not ideal because while SQL works well for structured data like user profiles, it is less efficient for handling highly dynamic, semi-structured data like the product catalog.
- B. Incorrect.
NoSQL for both use cases is not suitable because while NoSQL is great for the dynamic product catalog, it is not the best fit for structured data like user profiles where consistency and relational integrity are crucial.
- C. Correct.
SQL is the best fit for user profiles because they contain structured and consistent data, while NoSQL is better suited for the product catalog due to its flexible schema and ability to handle diverse attribute sets.
- D. Incorrect.
NoSQL for user profiles is inappropriate because user profiles require structured data storage with strong consistency, which SQL databases excel at. SQL for the product catalog is also a poor choice due to its lack of flexibility for semi-structured data.