Big Data: What is HBASE?
Join the DZone community and get the full member experience.
Join For FreeThe great thing about Big Data technology is that there are so many tools in the Data Scientists Tool Belt. The bad thing about Big Data Technology is that there are so many tools in the Data Scientists Tool belt.
When we talk about the tools that we use when working with Big Data, an overwhelming majority will discuss Hadoop, the Apache foundations implementation of Map Reduce and Distributed File Systems (HDFS in this instance. Which was created by Doug Cutting after Reading papers on the subject produced by Google Engineers while he was at Yahoo. (He is now at Cloudera). But big data tools rarely if ever work alone. It is a collection of tools and databases that help Data Scientists be more effective in their analysis (or just help to speed things up).
One of these technologies is HBase. HBase is a non-relational (NoSQL) database that is a Java implementation of Google Big Table. It is what is referred to as a Columnar Database. As oppose to Relational Database which stores its Data in Rows, it stores its data in Columns.
So that’s easy to say, but what exactly does that mean. Lets start with the definition Google lays out in its document on Big Table:
"A Bigtable is a sparse, distributed, persistent multidimensional sorted map."
Let's break that down to see what that means.
Sparse
A database is said to be sparse because of lack of data but not in the traditional sense of the term which would usually mean that there are very few items in the database. In relation to HBASE, it is called sparse because of its ability to have sparse data in its entities. What this means is as opposed to a relational table that would require you to fill out all (or most) of the fields (Think of a customer data table in a relational data base), a columnar database can be empty or NULL without it adversely affecting the database functionality. In addition, this also gives you the added benefit of being able to add other pieces of data you would like to capture on the fly. In a Relational Database, you create a schema (FirstName, LastName, SS#, TelephoneNumber) and hope that you have thought of all the data you need to capture at the time of creation. The NoSql schema-less databases allow you to add fields when needed or discovered without interrupting the normal flow of the operations.
Distributed and Persistent
HBase utilizes HDFS (the Hadoop Distributed File System) to distribute data across several commodity servers. This is how Hadoop and and HBase are able to work with vast amounts of data. It is based on another article from Google on the Google File System which Doug Cutting used as a basis for HDFS http://static.googleusercontent.com/media/research.google.com/en/us/archive/gfs-sosp2003.pdf . We will discuss HDFS and DFS in more detail in another post.
Multidimensional sorted Map
A Map (sometimes called and associative array) is a collection where the index of what is being stored does not have to be an integer but can also be arbitrary string. It is a collection of Key/Value pairs where the key is unique. The Keys are sorted in lexicographical order. (Not alphabetical, nor Alphanumeric, but sorting on the Unicode value of the string)
What you gain/give Up
Using HBase allows you to store your data both preprocessing and post processing in HBase and gives you some greater flexability and host billions of rows of data with rapid access. The downside is that when you use HBase instead of HDFS, tools like Hive (SQL like retrieval of data) are 4-5 times slower than plain HDFS. In addition, the maximum amount of data you can hold is about 1 petabyte as opposed to 30pb in HDFS.
In the next post will dive deeper into the specifics of HBase, like set up, usage, and analysis.
Published at DZone with permission of Daniel Egan, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments