Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How consistency works in HBase

Tags:

hadoop

hbase

From the CAP, I read HBase supports consistency and partition tolerance. I would like to know how consistency is achieved in HBase. Any locks are applied?

I checked online didn't find good material on this. Could any body provide any blogs/articles on this topic.

like image 891
Brainchild Avatar asked Dec 16 '22 01:12

Brainchild


1 Answers

Access to row data is atomic and includes any number of columns being read or written to. There is no further guarantee or transactional feature that spans multiple rows or across tables. The atomic access is a factor to this architecture being strictly consistent, as each concurrent reader and writer can make safe assumptions about the state of a row.

When data is updated it is first written to a commit log, called a write-ahead log (WAL) in HBase, and then stored in the (sorted by RowId) in-memory memstore. Once the data in memory has exceeded a given maximum value, it is flushed as an HFile to disk. After the flush, the commit logs can be discarded up to the last unflushed modification.

Thus a lock is needed only to protect the row in RAM.

like image 81
Evgeny Benediktov Avatar answered Jan 12 '23 21:01

Evgeny Benediktov