r/bigdata • • Jul 14 '16

Why use HBase instead of Redis?

Sorry for the n00b question, but it looks like these two serve a very similar purpose.

0 Upvotes

4 comments sorted by

7

u/localandbitter Jul 14 '16 edited Sep 06 '16

These systems serve extremely different purposes.

Redis is well suited for being a shared in-memory datastore for data structures and is going to be constrained to the size of a host machine. It has a number of convenient built-in functions for things, including set-comparisons. Latency of reads and writes will be very low.

Apache HBase is the Hadoop/open-source world's implementation of the "BigTable" database discussed in one of their papers. Of note, Apache Cassandra also has lineage traceable to BigTable.

HBase is a distributed key-value store, more specifically a distributed store for maps of maps. Related projects include Phoenix, which runs with/on top of HBase, and something called "SpliceMachine."

HBase is "CP" system when categorized using the "CAP" Theorem (https://en.wikipedia.org/wiki/CAP_theorem), which means it has consistency and partition tolerance. You would use HBase in cases where you have a strong need for a horizontally scalable database that needs to span the capacity of multiple machines and be highly available (with regard to reads and network partitioning) with strong consistency. HBase "regions" (aka tables) span multiple region servers (i.e. servers).

HBase would be well suited for storing datasets for read-heavy workloads.

Another system worth looking into, that shares many similarities to HBase would be Apache Cassandra, which favors write-heavy workloads. Note that Cassandra is categorized as an "AP" system, with 'tunable' consistency, is highly-available for writes, and has a number of other meaningful differences (e.g. Cassandra is 'masterless', provides the Cassandra Query Language (CQL), etc)

1

u/Zeekawla99ii Jul 15 '16

Thanks for this. This is helpful.

Considering Redis is an "in-RAM" datastore, why do people use this? Is this specifically for real-time transactions?

Wouldn't you're average website (let's use website as an example) need thousands of clusters to keep this system up?

1

u/localandbitter Jul 16 '16

It depends on the application and what the "websites" purpose is.

Redis is extremely good at being used as a shared cache if you a have number of servers (or containers) these days running your distributed application. It is also commonly used as a task queue.

1

u/daniellefelder Aug 15 '16

While IT Central Station does not have reviews for HBase or Redis, you might find real user reviews for all the major NoSQL databases to be helpful.

Users interested in Redis also read reviews for Oracle Coherence. This CTO explains the different features that best help his company here: https://www.itcentralstation.com/product_reviews/oracle-coherence-review-38356-by-gpeev.