Complete the code to create a Bigtable instance with the correct type for time-series data.
gcloud bigtable instances create my-instance --cluster=my-cluster --cluster-zone=us-central1-b --display-name=my-instance --instance-type=[1]The PRODUCTION instance type is used for Bigtable instances that handle real workloads, including time-series data.
Complete the code to create a Bigtable table with a column family for storing time-series data.
cbt createtable my-table
cbt createfamily my-table [1]The column family name metrics is commonly used to store time-series data in Bigtable.
Fix the error in the row key design for efficient time-series data storage.
row_key = '[1]#' + timestamp + '#' + sensor_id
Placing sensor_id first in the row key helps distribute writes evenly across Bigtable nodes, improving performance for time-series data.
Fill both blanks to create a Bigtable schema snippet that defines a column family and sets a garbage collection rule to keep only the last 7 days of data.
column_family = bigtable.ColumnFamily(name='metrics', gc_rule=bigtable.GCRule.[1](days=[2]))
The max_age garbage collection rule with days=7 keeps only data from the last 7 days.
Fill all three blanks to write a Python snippet that writes a time-series data point to Bigtable with the correct row key, column family, and column qualifier.
row_key = '[1]#' + timestamp row = table.row(row_key) row.set_cell('[2]', '[3]', value) row.commit()
The row key starts with the sensor ID sensor123. The column family is metrics, and the column qualifier is temperature to store the temperature value.