Google Cloud Associate Data Practitioner — Question 17
Your organization’s ecommerce website collects user activity logs using a Pub/Sub topic. Your organization’s leadership team wants a dashboard that contains aggregated user engagement metrics. You need to create a solution that transforms the user activity logs into aggregated metrics, while ensuring that the raw data can be easily queried. What should you do?
Answer options
- A. Create a Dataflow subscription to the Pub/Sub topic, and transform the activity logs. Load the transformed data into a BigQuery table for reporting.
- B. Create an event-driven Cloud Run function to trigger a data transformation pipeline to run. Load the transformed activity logs into a BigQuery table for reporting.
- C. Create a Cloud Storage subscription to the Pub/Sub topic. Load the activity logs into a bucket using the Avro file format. Use Dataflow to transform the data, and load it into a BigQuery table for reporting.
- D. Create a BigQuery subscription to the Pub/Sub topic, and load the activity logs into the table. Create a materialized view in BigQuery using SQL to transform the data for reporting
Correct answer: A
Explanation
Option A is the correct choice because it effectively uses Dataflow to transform the user activity logs and loads the processed data into BigQuery for easy reporting while keeping the raw data intact. Option B, while valid, does not specify the use of Dataflow for transformation, which is crucial for the requirement. Option C unnecessarily complicates the process by introducing Cloud Storage and Avro, which adds steps that could be avoided. Option D does not transform the data as required; it simply loads the logs into BigQuery without aggregation.