0
0
GCPcloud~30 mins

Bigtable for time-series data in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
Bigtable for time-series data
📖 Scenario: You are working for a weather monitoring company. You need to store temperature readings collected every minute from multiple weather stations. The data is time-series, meaning it is collected over time and needs to be stored efficiently for fast retrieval and analysis.
🎯 Goal: Create a Google Cloud Bigtable instance and table designed to store time-series temperature data from weather stations. You will define the table schema with appropriate column families and set up the instance configuration.
📋 What You'll Learn
Create a Bigtable instance named weather-instance with development type and located in us-central1-b zone.
Create a Bigtable table named temperature-readings inside the instance.
Add a column family named metrics to the table for storing temperature data.
Configure the column family with a max version of 1 to keep only the latest reading per timestamp.
💡 Why This Matters
🌍 Real World
Bigtable is often used to store large amounts of time-series data like sensor readings, logs, or financial data because it can handle high write throughput and fast queries.
💼 Career
Cloud engineers and data engineers use Bigtable to design scalable storage solutions for time-series data, which is common in IoT, monitoring, and analytics applications.
Progress0 / 4 steps
1
Create Bigtable instance configuration
Create a variable called instance_config as a dictionary with these exact keys and values: "instance_id": "weather-instance", "instance_type": "DEVELOPMENT", and "zone": "us-central1-b".
GCP
Need a hint?

Think of instance_config as a small map holding the instance details.

2
Define Bigtable table configuration
Create a variable called table_config as a dictionary with these exact keys and values: "table_id": "temperature-readings" and "column_families": {"metrics": {"max_versions": 1}}.
GCP
Need a hint?

Use nested dictionaries to define the column family and its max version.

3
Write function to create Bigtable instance
Define a function called create_instance that takes config as a parameter and returns a string confirming creation with the exact text: "Instance weather-instance created in us-central1-b with type DEVELOPMENT". Use config["instance_id"], config["zone"], and config["instance_type"] inside the function.
GCP
Need a hint?

Use an f-string to build the confirmation message using the config dictionary values.

4
Write function to create Bigtable table
Define a function called create_table that takes table as a parameter and returns a string confirming creation with the exact text: "Table temperature-readings created with column family metrics (max versions 1)". Use table["table_id"], the column family name "metrics", and table["column_families"]["metrics"]["max_versions"] inside the function.
GCP
Need a hint?

Extract the column family name and max versions from the table dictionary to build the confirmation string.