Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 93063 invoked from network); 5 Jul 2010 16:48:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Jul 2010 16:48:44 -0000 Received: (qmail 41538 invoked by uid 500); 5 Jul 2010 16:48:43 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 41486 invoked by uid 500); 5 Jul 2010 16:48:42 -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 41476 invoked by uid 99); 5 Jul 2010 16:48:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 16:48:42 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of yawyway@gmail.com designates 209.85.212.44 as permitted sender) Received: from [209.85.212.44] (HELO mail-vw0-f44.google.com) (209.85.212.44) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 16:48:36 +0000 Received: by vws14 with SMTP id 14so4784257vws.31 for ; Mon, 05 Jul 2010 09:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=/Hy0flHvYU3/vJiGQcdXdusYKGiH6caSN+LvoQNTalk=; b=pXFtLUW7ZTixGeI0bhGaJrdKTElGPmf1ErYfu8ia+5dfnUxyDNvlPX3TXak0ZlQL5t rzVTRDF2PoNl+efGN/dQc3rwAAQu+WG8APGpNTcbFUHWR5W08NNcPXKMPoDF9iSIwa8a pGoSvTZ3U0K7gk86oem2MPfSu9v7TYRvLLJuU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=WHBljyCoGIXpyvEua/BqarYBfLHtaj7MZVytysOCc677/xqgJFaQIowlT7BXY3GIY8 rcrfpU84Gvy9kH/aLqqQu2R9qJ4eg9SVKougcFxctpaVQ8JgprQLYK5z3uEHoZHfmLdo t4pIx+SWMY9brnvA1Ppr9ay95DbdGxjxvHYfo= MIME-Version: 1.0 Received: by 10.229.181.143 with SMTP id by15mr1735028qcb.248.1278348494879; Mon, 05 Jul 2010 09:48:14 -0700 (PDT) Received: by 10.229.95.77 with HTTP; Mon, 5 Jul 2010 09:48:14 -0700 (PDT) In-Reply-To: <4C2EE408.5060802@mykola.org> References: <4C2EE408.5060802@mykola.org> Date: Mon, 5 Jul 2010 18:48:14 +0200 Message-ID: Subject: Re: Storing application logs into Cassandra / design question From: yaw To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=001636310257efbc57048aa6b3a0 X-Virus-Checked: Checked by ClamAV on apache.org --001636310257efbc57048aa6b3a0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Perfectly right Nick. So i suppose that If I want to keep RandomPartionner ( I understand this is the best for high volume applications), I could design database like this : A CF with key =3D UUID will contain log message details =3D> allows me to = split real data evenly between nodes A CF with key =3D 'Date' and columns name are UUIDs (UUID sorted) =3D> all= ow me to get last X logs of the day and data are approximately well distributed..= . Many thanks, yaw 2010/7/3 =D0=9C=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0 =D0=A1=D1=82=D1=80=D1=94=D0= =B1=D0=BA=D0=BE=D0=B2 > On 02.07.10 16:10, yaw wrote: > > Hi all, > > I'd like to store logs of my application into cassandra. > > > > I need to query logs by date (last X logs) or user (give me last X log= s > > for user Y ) and I want to dispatch data among several servers. > > > > > > I think the best design way is following : > > > > Each log identifier is a time based UUID. > > > > > > A CF with key =3D UUID / *Random Partitioner* will contain log messag= e > > =3D> allows me to split real data evenly between nodes > > > > A CF with key =3D UUID and *order*-*preserving partitioner * allow me= to > > get last X logs > > > > A CF with key =3D userID and columns name are UUIDs (UUID sorted) =3D= > > > allow me to get last X logs of user Y > > > > Am I right ? > > No: you can have only one partitioner per cluster. See: > > > http://ria101.wordpress.com/2010/02/22/cassandra-randompartitioner-vs-ord= erpreservingpartitioner/ > > http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model > > -- > Mykola Stryebkov > Blog: http://mykola.org/blog/ > Public key: http://mykola.org/pubkey.txt > fpr: 0226 54EE C1FF 8636 36EF 2AC9 BCE9 CFC7 9CF4 6747 > --001636310257efbc57048aa6b3a0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Perfectly right Nick.
=C2=A0
So i suppose that If I want to keep RandomPartionner ( I understand th= is=C2=A0is the best for high volume applications), I could design database = like this :
=C2=A0
A CF with key =3D UUID=C2=A0 will contain log message details =3D> = allows me to split real data=C2=A0 evenly between nodes
=C2=A0
A CF = with key =3D 'Date'=C2=A0 and columns name are UUIDs (UUID sorted) = =3D> allow me to get last X logs of the day and data are approximately w= ell distributed...
=C2=A0
Many thanks,
yaw
=C2=A0
=C2=A0
2010/7/3 =D0=9C=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0 = =D0=A1=D1=82=D1=80=D1=94=D0=B1=D0=BA=D0=BE=D0=B2 <nick@mykola.org>
On 02.07.10 16:10, yaw wrote:
> Hi all,
> I&#= 39;d like to store logs of my application into cassandra.
>
> I= need to query logs by date (last X logs) or =C2=A0user (give me last X log= s
> for =C2=A0user Y ) =C2=A0and I want to dispatch data among several ser= vers.
>
>
> I think =C2=A0the best design way =C2=A0is = =C2=A0following :
>
> Each =C2=A0log identifier is a time based= UUID.
>
>
> A CF with key =3D UUID / =C2=A0*Random Parti= tioner* =C2=A0will contain log message
> =3D> allows me to split real data =C2=A0evenly between nodes
>= ;
> A CF with key =3D UUID =C2=A0 and *order*-*preserving partitioner= * allow me to
> get last X logs
>
> A CF with key =3D us= erID =C2=A0 and columns name are UUIDs (UUID sorted) =3D>
> allow me to get last X logs =C2=A0of user Y
>
> Am I right= ?

No: you can have only one partitioner per cluster. Se= e:

http://ria10= 1.wordpress.com/2010/02/22/cassandra-randompartitioner-vs-orderpreservingpa= rtitioner/

http://arin.me/blog/wtf-is-a-supercolumn-cassandra-dat= a-model

--
Mykola Stryebkov
Blog: = http://mykola.org/blo= g/
Public key: http= ://mykola.org/pubkey.txt
fpr: 0226 54EE C1FF 8636 36EF 2AC9 BCE9 CFC= 7 9CF4 6747

--001636310257efbc57048aa6b3a0--