Checkpoints
Configure node autoscaling
/ 35
Configure replication
/ 35
Create the backup and restore it
/ 30
Monitoring and Managing Bigtable Health and Performance
GSP1056
Overview
Bigtable is Google's fully managed, scalable NoSQL database service. Bigtable is ideal for storing large amounts of data in a key-value store and for use cases such as personalization, ad tech, financial tech, digital media, and Internet of Things (IoT). Bigtable supports high read and write throughput at low latency for fast access to large amounts of data for processing and analytics.
Bigtable provides many options for monitoring and managing the health and performance of your instance, including charts for storage (disk) and compute (CPU) utilization, flexible options for autoscaling of nodes, replication to improve the durability and availability of your data, and backup and restoration of tables.
In this lab, you access various charts to monitor disk usage in a Bigtable instance, update an existing cluster to use node autoscaling, implement replication in an instance, and back up and restore data in Bigtable.
What you'll do
In this lab, you learn how to monitor and manage the health and performance of a Bigtable instance.
- Monitor disk and CPU usage for a Bigtable instance.
- Configure node autoscaling and replication in Bigtable.
- Back up and restore data in Bigtable.
Prerequisites
- Basic understanding of database concepts and terms such as instances, schemas, and keys
- Completion of the lab titled Designing and Querying Bigtable Schemas
Setup and requirements
Before you click the Start Lab button
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.
This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
- Access to a standard internet browser (Chrome browser recommended).
- Time to complete the lab---remember, once you start, you cannot pause a lab.
How to start your lab and sign in to the Google Cloud console
-
Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is the Lab Details panel with the following:
- The Open Google Cloud console button
- Time remaining
- The temporary credentials that you must use for this lab
- Other information, if needed, to step through this lab
-
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
Note: If you see the Choose an account dialog, click Use Another Account. -
If necessary, copy the Username below and paste it into the Sign in dialog.
{{{user_0.username | "Username"}}} You can also find the Username in the Lab Details panel.
-
Click Next.
-
Copy the Password below and paste it into the Welcome dialog.
{{{user_0.password | "Password"}}} You can also find the Password in the Lab Details panel.
-
Click Next.
Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials. Note: Using your own Google Cloud account for this lab may incur extra charges. -
Click through the subsequent pages:
- Accept the terms and conditions.
- Do not add recovery options or two-factor authentication (because this is a temporary account).
- Do not sign up for free trials.
After a few moments, the Google Cloud console opens in this tab.
Activate Cloud Shell
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
- Click Activate Cloud Shell at the top of the Google Cloud console.
When you are connected, you are already authenticated, and the project is set to your Project_ID,
gcloud
is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
- (Optional) You can list the active account name with this command:
- Click Authorize.
Output:
- (Optional) You can list the project ID with this command:
Output:
gcloud
, in Google Cloud, refer to the gcloud CLI overview guide.
Task 1. Monitor disk usage
To ensure the performance of your Bigtable instance, it is important to monitor the disk and CPU usage for each cluster in your instance.
In this task, you use the Monitoring tab in Bigtable to review disk utilization for a cluster to ensure that the values are under the recommended thresholds.
Monitor disk utilization
In Bigtable, the storage capacity of each cluster is determined by the storage type (SSD or HDD) and the number of nodes. As the amount of data in a cluster increases, Bigtable redistributes the data across the nodes in the cluster.
In general, we recommend that you utilize less than 70% of disk storage in a cluster. For latency-sensitive applications, we recommend that storage utilization per node remain below 60%. As your data grows, you can add more nodes to maintain low latency.
-
In the Google Cloud Console, in the Navigation menu (), under Databases, click Bigtable.
-
Click on the instance ID named sandiego.
-
In the navigation menu for Bigtable, under Insights, click Monitoring.
-
For Group by, select Cluster.
Review the charts with names beginning with the prefix Storage.
You can calculate the storage usage per node by dividing the storage utilization in bytes by the number of nodes in the cluster.
Task 2. Configure node autoscaling
After reviewing the disk and CPU utilization of your clusters, you may need to increase the number of nodes to satisfy the recommended levels for compute and storage. Bigtable provides options for either manual allocation or autoscaling of node count in a cluster.
When autoscaling is enabled for a cluster, Bigtable adjusts the number of nodes to meet the targets for CPU and storage utilization. In this task, you enable autoscaling of nodes in an existing cluster in your Bigtable instance.
-
In the navigation menu for Bigtable, under Instance, click Overview.
-
From the list of cluster IDs, click on the cluster ID named sandiego-traffic-sensors-c1.
Review the details provided in the Overview section. The node scaling mode is currently set to Manually scale nodes.
-
To apply node autoscaling to the cluster, run the following command:
-
Refresh the page, and click Show details for Autoscale nodes.
Autoscaling has been applied to the cluster, starting with one node autoscaling up to three nodes. The CPU utilization target is set to the recommended value of 60%.
Click Check my progress to verify the objective.
Task 3. Configure replication
If an instance has only one cluster, the durability and availability of your data are limited to the zone where that cluster is located. Replication can improve both durability and availability by storing separate copies of your data in multiple zones or regions and automatically failing over between clusters if needed.
In this task, you configure replication in your Bigtable instance by adding a new cluster with autoscaling enabled to ensure the adequate provisioning of resources for the new cluster.
-
To return to the Overview page for the instance, click instance sandiego.
-
Click Edit instance.
-
Click Add cluster.
-
Enter the required information to create a new cluster:
Property | Value |
---|---|
Cluster ID | sandiego-traffic-sensors-c2 |
Region | |
Zone | Select any available zone. |
Node scaling mode | Autoscaling |
Minimum | 1 |
Maximum | 3 |
CPU utilization target | 60 |
-
Click Add.
-
Click Save.
In the list of cluster IDs, there are now two clusters:
- sandiego-traffic-sensors-c1
- sandiego-traffic-sensors-c2
Click Check my progress to verify the objective.
Task 4. Back up and restore data in Bigtable
In Bigtable, you can back up the schema and data of a table, and then restore the backup to a new table as needed. While replication is intended to enable failover to different regions or zones, backups are intended to help recover data from application-level data corruption or operational errors such as accidental table deletions.
In this task, you create a backup of the table named current_conditions, and then restore the backup to a new table in your instance.
Create a backup
-
In the navigation menu for Bigtable, under Instance, click Tables.
-
From the list of table IDs, in the line for current_conditions, click the Table action () menu, and then click Create backup.
The Table ID is prepopulated as current_conditions, and it will be the first available backup for the table.
-
For Cluster ID, select sandiego-traffic-sensors-c1.
The cluster ID identifies the cluster from which the table is backed up and the cluster where the backup is stored.
-
For Backup ID, type current_conditions_30.
-
For Set an expiration date, select 30 days.
The expiration date is automatically updated to 30 days from the present time.
-
Click Create.
Restore backup
In Bigtable, backups are not readable. To access the data in a backup, you can use the option for Restore on the Backups tab for Bigtable.
-
From the list of backup IDs, in the line for current_conditions_30, click Restore.
-
For Table ID, type current_conditions_30_restored.
-
Click Restore.
-
To remove the filter for table ID, click on the x next to Table: current_conditions_30_restored.
In the list of table IDs, there are now two tables:
- current_conditions
- current_conditions_30_restored
Click Check my progress to verify the objective.
Delete backup
You can also easily delete a backup when it is no longer needed.
-
In the navigation menu for Bigtable, under Instance, click Backups.
-
From the list of backup IDs, in the line for current_conditions_30, click on the three vertical dots, and select Delete.
-
In the confirmation dialog, type current_conditions_30
-
Click Delete.
Congratulations!
You have now completed key tasks to monitor and manage the health and performance of your Bigtable instance, including reviewing disk utilization, enabling node autoscaling and replication, and backing up and restoring data.
Next steps / Learn more
- Check out the lab titled Create and Manage Bigtable Instances: Challenge Lab.
Google Cloud training and certification
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated May 30, 2024
Lab Last Tested May 29, 2024
Copyright 2024 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.