PROFESSIONAL-DATA-ENGINEER · Question #374
You have terabytes of customer behavioral data streaming from Google Analytics into BigQuery daily. Your customers' information, such as their preferences, is hosted on a Cloud SQL for MySQL database.
The correct answer is C. Create streams in Datastream to replicate the required tables from both Cloud SQL databases to BigQuery for these queries.. C is correct because Datastream continuously replicates the Cloud SQL tables into BigQuery using Change Data Capture (CDC), so all 100–300 daily campaign queries run entirely within BigQuery - the Cloud SQL databases are only touched during replication, not during each query exec
Question
Options
- ACreate BigQuery connections to both Cloud SQL databases. Use BigQuery federated queries on the two databases and the Google Analytics data on BigQuery
- BCreate a job on Apache Spark with Dataproc Serverless to query both Cloud SQL databases and the Google Analytics data on BigQuery for these queries.
- CCreate streams in Datastream to replicate the required tables from both Cloud SQL databases to BigQuery for these queries.
- DCreate a Dataproc cluster with Trino to establish connections to both Cloud SQL databases and BigQuery, to execute the queries.
How the community answered
(43 responses)- A7% (3)
- B19% (8)
- C63% (27)
- D12% (5)
Explanation
C is correct because Datastream continuously replicates the Cloud SQL tables into BigQuery using Change Data Capture (CDC), so all 100–300 daily campaign queries run entirely within BigQuery - the Cloud SQL databases are only touched during replication, not during each query execution, directly satisfying the "minimize Cloud SQL load" requirement.
A is wrong because BigQuery federated queries reach out and hit Cloud SQL at query time - every one of those 300 peak queries would create a live connection to Cloud SQL, which is the opposite of minimizing its load.
B is wrong because a Dataproc Serverless Spark job would also connect directly to Cloud SQL each time it runs, adding load proportional to query frequency, and introduces unnecessary complexity for what is essentially a data movement and querying problem.
D is wrong for the same core reason as B and A - Trino on Dataproc queries Cloud SQL live at execution time, so each of the 300 peak runs hits the databases directly, and it also adds cluster management overhead.
Memory tip: Think "replicate once, query forever." Whenever a question says "minimize load on the source database" while enabling high-frequency queries, the answer involves moving the data into BigQuery first (Datastream = streaming replication), not querying the source on every run.
Topics
Community Discussion
No community discussion yet for this question.