Google Professional Cloud Developer Question 174
Select 2Google Cloud PlatformYou are developing an e-commerce application that needs to store user profiles, product catalogs, and real-time order transactions. User profiles require flexible schema designs as their attributes may evolve over time. The product catalog is structured with well-defined relationships, such as categories and inventory details. Order transactions require low-latency reads and writes for real-time operations. Which combination of database types should you use to meet these needs?
- A
Use a NoSQL database for user profiles, a relational database for the product catalog, and a NoSQL database for order transactions.
- B
Use a relational database for user profiles, a NoSQL database for the product catalog, and a relational database for order transactions.
- C
Use a NoSQL database for user profiles, a NoSQL database for the product catalog, and a relational database for order transactions.
- D
Use a relational database for user profiles, a relational database for the product catalog, and a NoSQL database for order transactions.
Show answer and explanation
Correct answers: A, D
Explanation
The choice of database depends on the type of data and application requirements. Flexible schema designs for user profiles make NoSQL a better choice. Structured data with well-defined relationships in the product catalog aligns well with relational databases. Real-time order transactions benefit from the high-speed, low-latency characteristics of NoSQL databases. Both options 1 and 4 correctly address these needs, with minor trade-offs for user profiles in option 4.
- A. Correct.
Correct: A NoSQL database is suitable for user profiles due to its schema flexibility. A relational database is ideal for the product catalog as it has well-defined relationships. A NoSQL database is also appropriate for order transactions due to its low-latency performance.
- B. Incorrect.
Incorrect: A relational database for user profiles is not ideal as the schema may frequently change. Using NoSQL for the product catalog is not suitable for structured relationships.
- C. Incorrect.
Incorrect: While NoSQL could work for user profiles, using NoSQL for the product catalog is not optimal for structured relationships. Additionally, a relational database for order transactions could introduce latency issues.
- D. Correct.
Correct: A relational database for the product catalog handles its structured schema well. A NoSQL database for order transactions ensures low-latency performance for real-time operations. However, using a relational database for user profiles may not be ideal for schema flexibility.