I took a first look at HBase recently and I like what I saw. HBase is an open source database system designed for use with Big Data.
HBase is primarily intended for use on Linux based machines, so installing HBase on a Windows machine was very difficult. Luckily, I was the technical editor for an upcoming book on HBase and the author created a virtual machine that had HBase installed. The image was Linux-based but there’s a system called Docker that allows you to run a Linux-based virtual machine with HBase installed, on a Windows machine.
In other words, instead of installing HBase directly, I relied on a pre-built image of an HBase installation on a Linux machine and I was able to run the virtual machine on a Windows system by using a system called Docker.
Here’s what the Docker shell looks like running on my Windows machine. Installing Docker wasn’t trivial but it was easier than installing HBase directly. You can see that Docker uses the CygWin bash window system:
Here’s how I loaded the virtual machine that the author had created. Docker looked for the image on my machine, didn’t find it, and so downloaded the image.
And here’s how I launch an HBase interactive environment, create an HBase table, put some data in, then query the table:
This command started the HBase interactive shell:
docker exec -it hbase hbase shell
This command create a table named tblEmployee with a “column family” named e (the notion of column families is an important HBase concept but one that’s outside the scope of this post):
create 'tblEmployee', 'e'
Here’s how I simultaneously create a key column (an employee ID), a lastName column, and an age column, and insert values for two employees:
put 'tblEmployee', '001', 'e:lastName', 'Adams' put 'tblEmployee', '001', 'e:age', '33' put 'tblEmployee', '002', 'e:lastName', 'Baker' put 'tblEmployee', '002', 'e:age', '42'
And here’s how I query the table for the employee with ID = 001:
get 'tblEmployee', '001'
It took me about a day to start to feel comfortable with HBase. Like anything, you can only learn it by using it, and the major challenge is getting the system installed.