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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With