Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-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 A5DA26637 for ; Wed, 18 May 2011 17:42:50 +0000 (UTC) Received: (qmail 41955 invoked by uid 500); 18 May 2011 17:42:48 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 41930 invoked by uid 500); 18 May 2011 17:42:48 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 41922 invoked by uid 99); 18 May 2011 17:42:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 May 2011 17:42:48 +0000 X-ASF-Spam-Status: No, hits=3.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rajkumar.w93@gmail.com designates 209.85.161.44 as permitted sender) Received: from [209.85.161.44] (HELO mail-fx0-f44.google.com) (209.85.161.44) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 May 2011 17:42:42 +0000 Received: by fxm15 with SMTP id 15so1592173fxm.31 for ; Wed, 18 May 2011 10:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=g48YrtDOzXoe02HTivqdjQdQOkoN/ku49HrTf8W4urs=; b=oNZwGUZln9oTZ1p6ksnYjspB/rdwtwq60pdkgFiOSBnjT9WwnwQ2jLjsJZvP6sy9aW 2vo8HjLUpVXpj4EHLjCvICP5y5GQKcIcBC9ysB8/fKtnjW4eIMUaaCjZZLzg4sUhF0dN LsckLgbmAGVOcN1eUvHxVsmuLpjQPb0TNT+iQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=d76aWbETnTT9cgzPDrtp2ah32ywnGY158GVVqUPfqNWttgx7IxiJBPHpuaaY08T+4H oUqK6LOvrUgyuWyT5lZbALt96GZqzv24NPig/hT+BR19FrFHQbd0+fICdnUV4b3tWtEj 8flc1bZYhG1gXOAIB0Kp/7nbBwvhcc11VS8zI= MIME-Version: 1.0 Received: by 10.223.144.144 with SMTP id z16mr2697100fau.24.1305740540948; Wed, 18 May 2011 10:42:20 -0700 (PDT) Sender: rajkumar.w93@gmail.com Received: by 10.223.122.71 with HTTP; Wed, 18 May 2011 10:42:20 -0700 (PDT) In-Reply-To: References: Date: Wed, 18 May 2011 23:12:20 +0530 X-Google-Sender-Auth: 8Duqf2KzPmsL1pLKypsodYIXnyk Message-ID: Subject: Re: Design for 'Most viewed Discussions' in a forum From: Aditya Narayan To: user Content-Type: multipart/alternative; boundary=0022158c0b511cb27a04a3906952 --0022158c0b511cb27a04a3906952 Content-Type: text/plain; charset=ISO-8859-1 I would arrange for memtable flush period in such a manner that the time period for which these most viewed discussions are generated equals the memtable flush timeperiod, so that the entire row of most viewed discussion on a topic is in one or maximum two memtables/ SST tables. This would also help minimize several versions of the same column in the row parts in different SST tables. On Wed, May 18, 2011 at 11:04 PM, Aditya Narayan wrote: > ************* > For a discussions forum, I need to show a page of most viewed discussions. > > For implementing this, I maintain a count of views of a discussion & when > this views count of a discussion passes a certain threshold limit, the > discussion Id is added to a row of most viewed discussions. > > This row of most viewed discussions contains columns with Integer names & > values containing serialized lists of Ids of all discussions whose views > count equals the Integral name of this column. > > Thus if the view count of a discussion increases I'll need to move its 'Id' > from serialized list in some column to serialized list in another column > whose name represents the updated views count on that discussion. > > Thus I can get the most viewed discussions by getting the appropriate no of > columns from one end of this Integer sorted row. > > ************ > > I wanted to get feedback from you all, to know if this is a good design. > > Thanks > > > > > > --0022158c0b511cb27a04a3906952 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I would arrange for memtable flush period in such a manner that the time pe= riod for which these most viewed discussions are generated equals the memta= ble flush timeperiod, so that the entire row of most viewed discussion on a= topic is in one or maximum two memtables/ SST tables.
This would also help minimize several versions of the same column in the ro= w parts in different SST tables.


On W= ed, May 18, 2011 at 11:04 PM, Aditya Narayan <adynnn@gmail.com> wrote:
*************
For a discussions forum, I= need to show a page of most viewed discussions.

For implementing th= is, I maintain a count of views of a discussion & when this views count= of a discussion passes a certain threshold limit, the discussion Id is add= ed to a row of most viewed discussions.

This row of most viewed discussions contains columns with Integer names= & values containing serialized lists of Ids of all discussions whose v= iews count equals the Integral name of this column.

Thus if the view= count of a discussion increases I'll need to move its 'Id' fro= m serialized list in some column to serialized list in another column whose= name represents the updated views count on that discussion.

Thus I can get the most viewed discussions by getting the appropriate n= o of columns from one end of this Integer sorted row.

************
I wanted to get feedback from you all, to know if this is a good desi= gn.

Thanks






--0022158c0b511cb27a04a3906952--