Skip to content

Kundera with HBase

karthikprasad13 edited this page Apr 7, 2016 · 3 revisions

HBase

Apache HBase is an open-source column-oriented, non-relational, distributed database that supports data versioning and is written in Java. It is developed as part of Apache Software Foundation's Apache Hadoop project and runs on the top of HDFS, providing BigTable-like capabilities for Hadoop. HBase can host very large tables consisting of billions of rows and millions of columns.

Support

Being a JPA provider, Kundera provides support for HBase. It allows to perform CRUD and query operation over HBase using JPA specifications. There are two implementations of Kundera for HBase.

  • kundera-hbase
  • kundera-hbase-v2

kundera-hbase

To use it, you need to have the following dependency in your pom.xml.

<dependency>
     <groupId>com.impetus.kundera.client</groupId>
     <artifactId>kundera-hbase</artifactId>
     <version>${kundera.version}</version>
</dependency>

In this implementation, a single hTable with multiple column families is used.

  • keyspace ==> hTable
  • entity ==> column family (a column family for each entity class)

kundera-hbase-v2

To use it, you need to have the following dependency in your pom.xml.

<dependency>
     <groupId>com.impetus.kundera.client</groupId>
     <artifactId>kundera-hbase-v2</artifactId>
     <version>${kundera.version}</version>
</dependency>

In this implementation, multiple hTables are used.

  • keyspace ==> namespace
  • entity ==> hTable (one hTable for each entity)

This implementation supports complex queries (nested AND OR queries), CRUD and query for nested embeddables, aggregations (using elastic as indexing store).

Persistence unit configuration

 <persistence-unit name="hbase_pu">
                <provider>com.impetus.kundera.KunderaPersistence</provider>
                <properties>
                        <property name="kundera.nodes" value="localhost" />
                        <property name="kundera.port" value="60000" />
                        <property name="kundera.keyspace" value="hbaseDB" />
                        <property name="kundera.dialect" value="hbase" />                     
                        <property name="kundera.ddl.auto.prepare" value="create" />
                        <property name="kundera.client.lookup.class"
                                value="com.impetus.client.hbase.HBaseClientFactory" />
                </properties>
</persistence-unit>


CRUD and Queries

For kundera-hbase, refer this test case

For kundera-hbase-v2, view this test case for CRUD and for Query

To-Do

  • Enable support for inheritance in kundera-hbase-v2
  • Enable support for 'BETWEEN' queries
Clone this wiki locally