Google Professional Cloud Developer Question 190
Single answerGoogle Cloud PlatformYou are building a real-time analytics platform for an e-commerce application using Google Cloud. The platform needs to handle a mix of high-frequency transactional data (e.g., purchases) and infrequent but large analytical queries (e.g., sales trends over the past year). Which combination of data storage and access pattern would be the most suitable for this use case?
- A
Use Cloud Spanner for transactional data and BigQuery for analytical queries, with real-time data streaming from Spanner to BigQuery.
- B
Use Firestore for transactional data and Cloud SQL for analytical queries, with periodic ETL jobs between the two.
- C
Use Bigtable for transactional data and BigQuery for analytical queries, with a shared schema across both systems.
- D
Use only Cloud SQL for both transactional and analytical queries to simplify the architecture.
Show answer and explanation
Correct answer: A
Explanation
When designing systems with mixed workloads, it is important to use purpose-built tools. Cloud Spanner provides global consistency and high availability for transactional workloads, while BigQuery delivers powerful, scalable analytics for large datasets. Streaming data from Spanner to BigQuery ensures low-latency synchronization, enabling the system to efficiently handle both real-time and historical queries.
- A. Correct.
This is the correct answer because Cloud Spanner is designed for high-frequency transactional workloads with strong consistency, while BigQuery is optimized for analytical queries. Streaming data from Spanner to BigQuery ensures near real-time analytics without impacting transactional performance.
- B. Incorrect.
This is incorrect because Firestore is more suited for document-based, hierarchical data models, and Cloud SQL is not optimized for large-scale analytical queries. Periodic ETL jobs would introduce latency and complexity.
- C. Incorrect.
This is incorrect because Bigtable is a good choice for low-latency, high-throughput workloads, but it is not ideal for transactional data requiring strong consistency. Additionally, sharing schemas between Bigtable and BigQuery is non-trivial and not recommended.
- D. Incorrect.
This is incorrect because Cloud SQL is a relational database suitable for transactional workloads, but it cannot handle large-scale analytical queries efficiently. Using a single database for both workloads would lead to performance bottlenecks.