From 8f90bbef9600de1aa1f2c98dff650bf3785d1c10 Mon Sep 17 00:00:00 2001 From: Doug Meil Date: Mon, 23 Jan 2012 02:27:54 +0000 Subject: [PATCH] hbase-5252. book.xml, added section in Data Model about joins git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1234674 13f79535-47bb-0310-9956-ffa450edef68 --- src/docbkx/book.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/docbkx/book.xml b/src/docbkx/book.xml index 7f349be9b55..8dc25f08f04 100644 --- a/src/docbkx/book.xml +++ b/src/docbkx/book.xml @@ -522,6 +522,19 @@ htable.put(put); +
Joins + Whether HBase supports joins is a common question on the dist-list, and there is a simple answer: it doesn't, + at not least in the way that RDBMS' support them (e.g., with equi-joins or outer-joins in SQL). As has been illustrated + in this chapter, the read data model operations in HBase are Get and Scan. + + However, that doesn't mean that equivalent join functionality can't be supported in your application, but + you have to do it yourself. The two primary strategies are either denormalizing the data upon writing to HBase, + or to have lookup tables and do the join between HBase tables in your application or MapReduce code (and as RDBMS' + demonstrate, there are several strategies for this depending on the size of the tables, e.g., nested loops vs. + hash-joins). So which is the best approach? It depends on what you are trying to do, and as such there isn't a single + answer that works for every use case. + +
@@ -756,6 +769,10 @@ System.out.println("md5 digest as string length: " + sbDigest.length); // ret +
Joins + If you have multiple tables, don't forget to factor in the potential for into the schema design. + +
Time To Live (TTL) ColumnFamilies can set a TTL length in seconds, and HBase will automatically delete rows once the expiration time is reached.