You have a sensors table (500 MB) with sensor metadata updated hourly. Each sensor emits a metric every 30 seconds with a timestamp. You need to store metrics in BigQuery, run weekly analytics, and minimize cost. Which data model do you use?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a metrics table partitioned by timestamp. Create a sensorId column in the metrics table, that points to the id column in the sensors table. Use an INSERT statement every 30 seconds to append new metrics to the metrics table. Join the two tables, if needed, when running the analytical query..
Why this is the answer
The correct option leverages BigQuery's strengths for time-series data and cost optimization. Creating a separate metrics table partitioned by timestamp allows for efficient data ingestion and querying. Appending new metrics every 30 seconds via INSERT is BigQuery's recommended and most cost-effective method for high-volume data, as it avoids expensive UPDATE operations. Partitioning by timestamp significantly reduces scan costs for weekly analytics by allowing BigQuery to only process relevant partitions. Joining with the sensors table when needed is standard practice for relational data. The incorrect options involving UPDATE statements are inefficient and costly in BigQuery, especially at a 30-second frequency, as BigQuery is optimized for append-only operations. Storing repeated metrics directly within the sensors table (even with RECORD and REPEATED types) would lead to very large rows, making updates and queries on the metrics data less performant and more expensive than a dedicated, partitioned metrics table.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed