Many applications cases have demand of real time processing on Big Data. No worries, Apache HBase a versioned, column oriented data store is there to help us in real time processing on Big Data.Apache HBase is modeled based on Google's paper on BigTable. HBase is built on Hadoop and HDFS.
HBase provides two basic features.
It provides us access to Hadoop from database prospective.
It provides us transactional platform to work on multi cluster environment.
Is HBase replacement on RDBMS?
In my opinion HBase can be treated as replacement for RDBMS in only case when we have enough data like millions/billions of records.
Let's see the basic terminology of HBase
1.Table
HBase stores data in tables. Table has a row columns structure. There is a concept of Row key (Primary Key in RDBMS) and column values in HBase Table. Any thing which can be converted into byte array can be used as a Row key. Columns are categorized into column families.
In rdbms database we would be storing this record like (10001, firstName, lastName, Xebia). But here we have stored multiple rows for single Row Key. This is the reason that we can add any number of columns to a column family and that is not the case with rdbms table because at runtime we can not add columns to rdbms table.
2. Column Family
Like columns are fixed in rdbms table means we can not add column on runtime but later we can use DDL Alter table and add columns. In HBase as well we define column families while during schema definition and we can not add column families on runtime. Alter statements are provided by HBase to add column families but on runtime this is not possible.
3. Regions
As soon as data grows beyond the capacity of one node HBase automatically partition the table into regions. Regions are represented with table name, start row (inclusive) and end row (exclusive).
HBase Architecture
HBase works on the theme of master and slave like HDFS or Map Reduce. Here master is known as HBase Master and slaves as Region Servers. HBase Master keeps information about all the region servers.
How HBase stores Data?
HBase maintains two internal tables call it as Catalog tables.
-ROOT-
-ROOT- table keeps track of the .META. table.
Key : .META. Region key
values
info : regioninfo (serialized instance of .META.)
info : server (server:port of Region Server process holding .META.)
info : serverstartcode (start-time of Region Server process holding .META.)
.META.
.META. Table keeps track of all the regions in the system.
Key : Region key which is comprises of (table name, region start key, region id)
values
info : regioninfo (serialized instance of region)
info : server (server:port of Region Server process holding region)
info : serverstartcode (start-time of Region Server process containing region)
What is Compaction?
When we write some data to regions it first appended to the commit log and the added to the memstore (in memory). When memstore fills and threshold limit crossed then data is flushed to the file system. This process is called Compaction. Compaction serves the physical deletion for the delete requests as well.
Link Source: http://xebee.xebia.in/index.php/2013/02/27/hbase-a-real-time-access-to-big-data/