Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 18261FA46 for ; Sun, 7 Apr 2013 18:58:52 +0000 (UTC) Received: (qmail 26983 invoked by uid 500); 7 Apr 2013 18:58:49 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 26934 invoked by uid 500); 7 Apr 2013 18:58:49 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 26926 invoked by uid 99); 7 Apr 2013 18:58:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Apr 2013 18:58:49 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of yuzhihong@gmail.com designates 209.85.220.51 as permitted sender) Received: from [209.85.220.51] (HELO mail-pa0-f51.google.com) (209.85.220.51) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Apr 2013 18:58:42 +0000 Received: by mail-pa0-f51.google.com with SMTP id jh10so2870273pab.38 for ; Sun, 07 Apr 2013 11:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=RedJ9etFpMM1hs3nDi7vTjplpE7rnbsCh2ddBg32CEI=; b=O1NxPt9XAbIW1ieWU+fmRnwE5ac6y5SbSOPVVTmPC8mR0uzcRy6O4HYd60LW0Zcv4O WlTZlcjWF0oIn/zSZfC0U3t6YToxKEEpsmSn2Sd1qdvL1KTZb4JzelCmA4hdPayQfERM hV5f06CEifBE1JxwKAlWydJj0JnKu9HNhjwbBJq85uH+qT2yQFrNUjbeyB1Q8gDDw9rv 0qtxFoM+wkgw6Ew85o3uoxLpMBabW9TpPvMyDB/pYhwcbR5ZFNK83LQZRLM40du/6tsK 7kDgNsyDGIy7VI26QKEXbugVq8q5B0W3gjEjvgaAv4VZWzq6olkMRZ7YfBOLWO/YwbTr TrrQ== X-Received: by 10.66.176.205 with SMTP id ck13mr30917268pac.50.1365361101018; Sun, 07 Apr 2013 11:58:21 -0700 (PDT) Received: from [10.179.218.46] (218.sub-70-211-70.myvzw.com. [70.211.70.218]) by mx.google.com with ESMTPS id li15sm32199785pab.2.2013.04.07.11.58.18 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 07 Apr 2013 11:58:19 -0700 (PDT) References: Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <6A60EF94-70B1-4077-B293-10CE95B298E8@gmail.com> Cc: "user@hbase.apache.org" X-Mailer: iPhone Mail (10B146) From: Ted Subject: Re: schema design: rows vs wide columns Date: Sun, 7 Apr 2013 11:58:16 -0700 To: "user@hbase.apache.org" X-Virus-Checked: Checked by ClamAV on apache.org If you store service Id by month, how do you deal with time range in query t= hat spans partial month(s) ? With regard to number of column families, 3 is the recommended maximum.=20 Cheers On Apr 7, 2013, at 1:03 AM, shawn du wrote: > Hello, >=20 > I am newer for hbase, but i have some experience on cassandra. In the > official document, it is said prefer to use rows instead of columns. I > don't know whether I should follow. > This is my user case: > I have about hundreds of services. each service is stored by a > number(service id). we try to store users registration for specific servic= e > in a day. > so there are two solutions for this: > rows: > rowkey: month(2013-03) columns will be each service ids. values will be th= e > number for each service. > wide columns: > rowkey: serviceId, columns/values will be months and numbers. >=20 > Query requirement: > we only query for a specific service id and time between a start time and > end time. >=20 > so which solution is better? >=20 > also another question: > it is said that we 'd better desgin less than 3 column families. it is > true? can i create as many as tables i need in hbase? >=20 > Thanks in advance. >=20 > BR.Shawn