0
0
GCPcloud~10 mins

Bigtable for time-series data in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a Bigtable instance with the correct type for time-series data.

GCP
gcloud bigtable instances create my-instance --cluster=my-cluster --cluster-zone=us-central1-b --display-name=my-instance --instance-type=[1]
Drag options to blanks, or click blank then click option'
ADEVELOPMENT
BTIME_SERIES
CSTANDARD
DPRODUCTION
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing DEVELOPMENT instance type which is for testing only.
Using a non-existent instance type like TIME_SERIES.
2fill in blank
medium

Complete the code to create a Bigtable table with a column family for storing time-series data.

GCP
cbt createtable my-table
cbt createfamily my-table [1]
Drag options to blanks, or click blank then click option'
Ametrics
Bdata
Ctimeseries
Dcf1
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic names like 'data' which are less descriptive.
Using multiple column families unnecessarily.
3fill in blank
hard

Fix the error in the row key design for efficient time-series data storage.

GCP
row_key = '[1]#' + timestamp + '#' + sensor_id
Drag options to blanks, or click blank then click option'
Aregion
Btimestamp
Csensor_id
Ddevice
Attempts:
3 left
💡 Hint
Common Mistakes
Using timestamp first causes hotspotting in Bigtable.
Using region or device without context may not distribute data well.
4fill in blank
hard

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.

GCP
column_family = bigtable.ColumnFamily(name='metrics', gc_rule=bigtable.GCRule.[1](days=[2]))
Drag options to blanks, or click blank then click option'
Amax_age
Bmax_versions
C7
D30
Attempts:
3 left
💡 Hint
Common Mistakes
Using max_versions instead of max_age for time-based data retention.
Not setting the days parameter correctly.
5fill in blank
hard

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.

GCP
row_key = '[1]#' + timestamp
row = table.row(row_key)
row.set_cell('[2]', '[3]', value)
row.commit()
Drag options to blanks, or click blank then click option'
Asensor123
Bmetrics
Ctemperature
Dtimestamp
Attempts:
3 left
💡 Hint
Common Mistakes
Using timestamp as the first part of the row key causing hotspots.
Using wrong column family or qualifier names.