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 45F5A10CB6 for ; Thu, 5 Sep 2013 14:42:15 +0000 (UTC) Received: (qmail 49105 invoked by uid 500); 5 Sep 2013 14:42:12 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 48806 invoked by uid 500); 5 Sep 2013 14:42:09 -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 48795 invoked by uid 99); 5 Sep 2013 14:42:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Sep 2013 14:42:08 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of marcoscaixetasousa@gmail.com designates 209.85.223.171 as permitted sender) Received: from [209.85.223.171] (HELO mail-ie0-f171.google.com) (209.85.223.171) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Sep 2013 14:42:01 +0000 Received: by mail-ie0-f171.google.com with SMTP id 9so3956804iec.30 for ; Thu, 05 Sep 2013 07:41:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=Rfboz32AAjGb2YhSOrbk2iA8x2QIn3gRov5xTZJ/Mgk=; b=Its05TlHtZ8LO01r9DeTC1FMTxoxMeSKVStGYXkUNpgvfSgm5M7e573E5j674XBJbC jRs/SmR/NNinEUjp+BzrESAngv0dcTNSlzDUtI4na3utg0+cMvJmpWBLIdvZWDVSj3Gx Bcpa82Y7eIw2PzARxVJEgoduhRVaCTTaTEpuIf44+XLQ6iKBWI6J6/1WLU4g3b5/3w8C k10bYsZK1RKysdca7w68oIDoMTCQGzD73vvA0Npf/zTOl+cu47LbgDV8rq/VaY+S79YL 5j7KyPzCqfMACSm2/roufO62jaa1cPpjhNo17s51rkpeZ1PqPGDhILO/rFwKCIxTiMGP OVsw== X-Received: by 10.43.78.196 with SMTP id zn4mr762742icb.55.1378392101042; Thu, 05 Sep 2013 07:41:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.82.105 with HTTP; Thu, 5 Sep 2013 07:41:20 -0700 (PDT) In-Reply-To: References: From: Marcos Sousa Date: Thu, 5 Sep 2013 11:41:20 -0300 Message-ID: Subject: Re: user action modeling To: user Content-Type: multipart/alternative; boundary=001a11c3b8348b42f804e5a3ebd4 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c3b8348b42f804e5a3ebd4 Content-Type: text/plain; charset=ISO-8859-1 Hi, Yes, that the point, I need to save dynamic parameters for each action :( I was thinking about, distributing the data in 3 tables: - users: which I have all data about user and the list of friends and documents that he performed the action - user_actions: to save action and futher parameters - objects: save the list of users who performed the action. Replicating data like that, I will have 3 times more writing operations. Curiously, the intersect part, aka friends who did the same action, is one of the most used part. Regards, Marcos Sousa On Thu, Sep 5, 2013 at 10:55 AM, Shahab Yunus wrote: > Your read queries seem to be more driven form the 'action' and 'object' > perspective, rather than user. > > 1- So one option is that you make a composite key with action and object: > > action|object and the columns are users who are generating events on this > combination. You can scan using prefix filter if you want to look at data > specific set of action and object i.e. your requirements 1, 3 & 4. Key > distribution should be OK too. The drawbacks here are that a) you can end > up with really wide rows b) what if you want to store more information than > just user id in the columns? > > The friends part is not that trivial and you have to maintain that > relationship out of this main table or create complex composite entities (I > need to think about it more, HBase is not a graph database.) > > Regards, > Shahab > > > On Thu, Sep 5, 2013 at 1:16 AM, Marcos Sousa > wrote: > > > Hi, > > > > I'm working with HBase since the last 3 moths, now I have to store user > > actions, at first look, using Hbase. > > > > I have a limited number of actions, thousands of objects and about 50 > > million users interacting with them, around 2 billion interactions per > > month. > > > > I have to answer there questions: > > How many users performed action 'foo' at object 'bar' > > What friends performed performed action 'foo' at object 'bar' > > What users made 'foo' at object 'bar' last week. > > What objects received more action 'foo' > > > > Does anybody have suggestions to a schema for this problem? > > > > Best regards, > > > > -- > > Marcos Sousa > > > --001a11c3b8348b42f804e5a3ebd4--