Google Cloud: Introduction to Cloud BigTable

Share At:

What is BigTable?

Bigtable is a distributed database that runs on clusters for applications that has massive data. Its mainly designed for unstructured data, and scales horizontally.

Cloud Bigtable is not a relational database system. It stores data in key-value pairs.

When to choose BigTable and BigQuery?

  • For Interactive querying in an online analytical processing system use BigQuery.
  • BigQuery is a data warehouse application, and it stores data in structured tables.
  • BigQuery supports SQL queries whereas BigTable doesn’t support SQL queries.
  • BigTable is not a recommended solution for a small volume of data(< 1 TB).
  • BigTable is characteristic of a NoSQL system whereas BigQuery is somewhat of a hybrid where it is mainly used for SQL queries but it does support NoSQL as well.
  • For e.g. If you want to do analytics or business intelligence from collected data from different sources into one location i.e BigQuery.
  • Simple, Database — BigTable whereas Analytics — BigQuery

Lab Details:

  1. This lab walks you through BigTable, how it is different from BigQuery.
  2. You will be creating a BigTable Cluster and Table.

Lab Tasks:

  1. Login into GCP Console.
  2. Creating BigTable Instance.
  3. Creating a BigTable Cluster.
  4. Create a Table.
  5. Create a Column Family.
  6. Inserting data into Table.
  7. Reading data through the Table.

Creating a BigTable Instance

  1. Click on the hamburger icon on the top left corner.
  2. Click on Bigtable under the Databases section.

3. Click on Create Instance.

4. Enter instance name as whizlabs-bt-admin.

5. It will automatically generate an instance id like whizlabs-bt-admin.

6. Click on Continue.

7. Select the storage type as HDD.

8. Click on Continue.

Creating a BigTable Cluster

  1. Enter the Cluster ID as whizlabs-cluster.
  2. Select the region as us-central1 and zone you can choose any.
  3. Enter the nodes as 1.

4. Click on Create.

5. You can see your Instance listed. Click on your instance id.

6. You will be able to see more details about the cluster.

Creating a Table and querying the data

  1. Start Cloud Shell from the top bar.
  2. Enter the command and replace project id with your project id:-

echo -e “project = <project_id>\ninstance = whizlabs-bt-admin” > ~/.cbtrc

It will store the variables for project id and instance id in a file name cbtrc.

3. Enter the command to create a table.

cbt createtable whizlabs-bt-lab

4. Enter the command to create a column family.

cbt createfamily whizlabs-bt-lab employee_name

5. Enter the command to insert the data.

cbt set whizlabs-bt-lab r1 employee_name:c1=martha

6. Enter the command to insert the data.

cbt set whizlabs-bt-lab r1 employee_name:c2=rachel

7. Enter the command to fetch the data.

cbt read whizlabs-bt-lab

Completion and Conclusion:

  1. In this lab, you have created a BigTable Instance.
  2. You have created a BigTable Cluster
  3. You have created a Table and Column Family in Cluster.
  4. You have inserted data into the table.
  5. You have read the data from the table.

Happy Learning !!!


Share At:
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Back To Top

Contact Us