Topic 1 Question 302
You work for a farming company. You have one BigQuery table named sensors, which is about 500 MB and contains the list of your 5000 sensors, with columns for id, name, and location. This table is updated every hour. Each sensor generates one metric every 30 seconds along with a timestamp, which you want to store in BigQuery. You want to run an analytical query on the data once a week for monitoring purposes. You also want to minimize costs. What data model should you use?
- Create a metrics column in the sensors table.
- Set RECORD type and REPEATED mode for the metrics column.
- Use an UPDATE statement every 30 seconds to add new metrics.
- Create a metrics column in the sensors table.
- Set RECORD type and REPEATED mode for the metrics column.
- Use an INSERT statement every 30 seconds to add new metrics.
- 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.
- Create a metrics table partitioned by timestamp.
- Create a sensorId column in the metrics table, which points to the id column in the sensors table.
- Use an UPDATE statement every 30 seconds to append new metrics to the metrics table.
- Join the two tables, if needed, when running the analytical query.
ユーザの投票
コメント(3)
Partitioned Metrics Table: Creating a separate metrics table partitioned by timestamp is a standard practice for time-series data like sensor readings. Partitioning by timestamp allows for more efficient querying, especially when you're only interested in a specific time range (like weekly monitoring). Reference to Sensors Table: Including a sensorId column that references the id column in the sensors table allows you to maintain a relationship between the metrics and the sensors without duplicating sensor information. INSERT Every 30 Seconds: Using an INSERT statement every 30 seconds to the partitioned metrics table is a standard approach for time-series data ingestion in BigQuery. It allows for efficient data storage and querying. Join for Analysis: When you need to analyze the data, you can join the metrics table with the sensors table based on the sensorId, allowing for comprehensive analysis with sensor details.
👍 2raaad2024/01/06- 正解だと思う選択肢: C
Option C
👍 2raaad2024/01/06 - 正解だと思う選択肢: C
C.
- 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.
👍 1scaenruy2024/01/04
シャッフルモード