Book Image

HBase Essentials

By : Nishant Garg
Book Image

HBase Essentials

By: Nishant Garg

Overview of this book

Table of Contents (14 chapters)

Counters


In the Web 2.0 world, most of the e-commerce applications collect statistics such as user clicks, likes, views, and so on. Earlier this data used to be collected from the application logfiles, which were subsequently analyzed to get the results.

Counters are another advanced and useful feature provided by HBase. Counters allow us to increment a column value with the least overhead by providing a mechanism to treat columns as counters. Using counters enables the potential of real-time accounting and completely takes away the offline batch-oriented logfile analysis.

Normally, incrementing column values requires steps such as locking the row, reading, incrementing, writing the value, and finally releasing the row for other writers. These steps cause a lot of I/O overheads and wait for other writers. Counters avoid all these I/O-centric steps by synchronizing the write operation over a row and incrementing values under a single row lock. Therefore, counters work only with a single row...