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 9474A4A86 for ; Mon, 23 May 2011 18:55:32 +0000 (UTC) Received: (qmail 86726 invoked by uid 500); 23 May 2011 18:55:30 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 86706 invoked by uid 500); 23 May 2011 18:55:30 -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 86697 invoked by uid 99); 23 May 2011 18:55:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 May 2011 18:55:30 +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 ryan@twitter.com designates 209.85.220.172 as permitted sender) Received: from [209.85.220.172] (HELO mail-vx0-f172.google.com) (209.85.220.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 May 2011 18:55:23 +0000 Received: by vxg33 with SMTP id 33so5192627vxg.31 for ; Mon, 23 May 2011 11:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=twitter.com; s=google; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=dspn5eYcwbVuS6CifqPxFGYspZY/LI0F99kWRogPGM8=; b=qoXvlOP9nOcKjF9iFWK2bhZMi+GWkiylEcsWnyiVB7KvGptNDMa82DRZ8O9AUtQu4r QiR24GhOuF6Tvvzv2cbvidwi4iAkaQRCK2calf90DUZydUYWG5Ml8/vMtFCCA64uc0OP OCFzdQTFEUpuQV6TjcNjEivyBislH8CgwUAr0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=twitter.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=jY+tgee3RyxIVNEc8B94rDuqk/ykCyORLTB5HFjPmCCYEELivGH/k6A9B1DbNlJs9v ZfgRkyK28CntEJ4sdV+4z9HQ3U71gsSX/McuNBMds7BPtJQQ1vmiiUB/s4LXTXSa3mxA sd8J9yaVCnDU2W2iOd3AJryb4tOY+LVwbyVWI= Received: by 10.52.71.240 with SMTP id y16mr4102891vdu.125.1306176902256; Mon, 23 May 2011 11:55:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.182.166 with HTTP; Mon, 23 May 2011 11:54:42 -0700 (PDT) In-Reply-To: References: <8BEFDE0B-9EA3-44B2-A9B7-E077F138AEBD@thelastpickle.com> From: Ryan King Date: Mon, 23 May 2011 11:54:42 -0700 Message-ID: Subject: Re: rainbird question (why is the 1minute buffer needed?) To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Sun, May 22, 2011 at 11:00 AM, Yang wrote: > Thanks, > > I did read through that pdf doc, and went through the counters code in > 0.8-rc2, I think I understand the logic in that code. > > in my hypothetical implementation, I am not suggesting to overstep the > complicated logic in counters code, since the extra module will still > need to enter the increment through StorageProxy.mutate( > My_counter.delta=3D1 ) , so that the logical clock is still handled by > the Counters code. > > =A0the only difference is, as you said, > that rainbird collapses many +1 deltas. but my claim is that in fact > this "collapsing" is already done by cassandra since the write always > hit the memtable =A0first, > so collapsing in Cassandra memtable vs collapsing in rainbird =A0memory > takes the same time, while rainbird introduces an extra level of > caching (I am strongly suspecting that rainbird is vulnerable to > losing up to 1minute's worth of data , if the rainbird dies before the > writes are flushed to cassandra ---- unless it does implement its own > commit log, but that is kind of =A0re-implementing many of the wheels in > Cassandra ....) Right, Rainbird buffers for performance and can lose up to 1 minute of data= . > I thought at one time probably the reason was because that from one > given url, rainbird needs to create writes on many keys, so that they > keys need to go to different > Cassandra nodes. but later I found that this can also be done in a > module on the coordinator, since the client request first hits a > coordinator, instead of the data node, in fact, in a multi-insert > case, the coordinator already sends the request to multiple data > nodes. the extra module I am proposing simply translates a single > insert into multi-insert, and then cassandra takes over from there > > > Thanks > Yang > > On Sun, May 22, 2011 at 3:47 AM, aaron morton w= rote: >> =A0The implementation of distributed counters is =A0more complicated tha= n your >> example, there is a design doc attached to the ticket >> here=A0https://issues.apache.org/jira/browse/CASSANDRA-1072 >> By collapsing some of those +1 increments together at the application le= vel >> there is less work for the cluster to do. This can be important when the >> numbers are big=A0http://blog.twitter.com/2011/03/numbers.html >> Cheers >> ----------------- >> Aaron Morton >> Freelance Cassandra Developer >> @aaronmorton >> http://www.thelastpickle.com >> On 21 May 2011, at 09:04, Yang wrote: >> >> (sorry if Rainbird is not a topic relevant enough, I'd appreciate if >> someone could point me to a more appropriate venue in that case) >> >> >> Rainbird buffers up 1 minute worth of events first before writing to >> Cassandra. >> >> it seems that this extra layer of buffering is repetitive, and could >> be avoided : Cassandra's memtable already does buffering, whose >> internal implementation is just >> Map.put(key, CF ) , I guess rainbird does similar things : >> column_to_count =3D map.get(key); column_to_count++ ; map.put(key, >> column_to_count) ?? >> the "++" part is probably already done by the Distributed Counters in >> Cassandra. >> then I guess Rainbird layer exists because it needs to parse an >> incoming event into various attributes that it is interested in: for >> example from an url, we bump up the counts of >> FQDN , domain, path etc, Rainbird does the transformation from >> url--->3 attrs. >> >> but I guess that transformation might as well be done in the cassandra >> JVM itself, if we could provide some hooks, so that a module >> translates incoming request into >> multiple keys, and bump up their counts. that way we avoid the >> intermediate communication from clients to rainbird, =A0and rainbird to >> Cassandra. are there some points I'm missing? >> >> Thanks >> Yang >> >> >