0
votes

I am working on an IOT application which reads data from some sensors and I need to populate this data into a Google Cloud Bigtable instance. I am using Java 1.8 for development and I will be using HBase APIs for Bigtable related operations.

Can someone please let me know what are the steps to create a Bigtable instance so I can connect to it from within my java application?

Thanks

2

2 Answers

1
votes

The easiest way is to first create a BT instance in the Cloud Console on the website and then connect to it in Java by specifying the ProjectID and the Instance ID:

Connection = BigtableConfiguration.connect(PROJECT_ID, INSTANCE_ID);

PROJECT_ID is your Cloud project (make sure to use the actual project ID rather than the alias) and INSTANCE_ID is the name you gave to your BT instance via the website.

The page to create the BT instance is within the menu at the top-left of the Cloud Console page.

Some personal observations:
1 Your instance is billed hourly, so don't forget to delete it when done (YOUR DATA WILL BE DELETED)
2 You will be charged for each hour that it's on (i.e. even if you keep it for 5 min, you will be charged for the full hour)
3 Create the Connection object once and re-use it.
4 When creating an instance, specify the region where your client is, to avoid network charges
5 Don't expect all HBase API and functionality to fully work in Bigtable, but most of it does