Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 61687 invoked from network); 26 May 2010 09:46:26 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 May 2010 09:46:26 -0000 Received: (qmail 64106 invoked by uid 500); 26 May 2010 09:46:25 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 64035 invoked by uid 500); 26 May 2010 09:46:25 -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 64027 invoked by uid 99); 26 May 2010 09:46:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 May 2010 09:46:24 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.82.172] (HELO mail-wy0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 May 2010 09:46:17 +0000 Received: by wye20 with SMTP id 20so2130164wye.31 for ; Wed, 26 May 2010 02:45:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.182.71 with SMTP id n49mr1019815wem.168.1274867154967; Wed, 26 May 2010 02:45:54 -0700 (PDT) Received: by 10.216.230.24 with HTTP; Wed, 26 May 2010 02:45:54 -0700 (PDT) Date: Wed, 26 May 2010 21:45:54 +1200 Message-ID: Subject: Questions regarding batch mutates and transactions From: Todd Nine To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0016e6498436e85bbb04877c238b X-Virus-Checked: Checked by ClamAV on apache.org --0016e6498436e85bbb04877c238b Content-Type: text/plain; charset=ISO-8859-1 Hey guys, I originally asked this on the Hector group, but no one was sure of the answer. Can I get some feedback on this. I'd prefer to avoid having to use something like Cages if I can for most of our use cases. Long term I can see we'll need to use something like Cages, especially when it comes to complex operations such as billing. However for a majority of our uses, I think it's a bit overkill. I've used transactions heavily in the workplace on SQL based app developments. To be honest, a majority of application's I've built utilize optimistic locking, and only the atomic, consistent, and durable functionality of transactional ACID properties. To encapsulate all 3, I essentially need all writes to cassandra for a given business invocation to occur in a single write. With Spring, I would implement my own transaction manager which simply adds all mutates and delete ops to a batch mutate. When my transaction commits, I would execute the mutation on the given keyspace. Now this would only work if the following semantics apply. I've tried searching for details in Cassandra's batch mutate, but I'm not finding what I need. Here are 2 use cases as an example. Case 1: Successful update : User adds new contact Transaction Start. Biz op 1. Row is created in "contacts" and all data is added via batch mutation Biz op 2. Row is created for an SMS message is created for queueing through the SMS gateway return op 2 return op 1 Transaction Commit (batch mutate executed) Case 2. Failed update: User adds new contact Biz op 1. Row is created in "contacts" Biz op 2. Row is created for SMS message queuing. Fails due to invalid international phone number format return op 2 return op 1 Transaction is rolled back (batch mutate never executed) Now, here is where I can't find what I need in the doc. In case 1, if my mutation from biz op 2 were to fail during a batch mutate operation encapsulating all mutations, does the batch mutation as a whole not get executed, or would I still have the mutation from op 1 written to cassandra while the op 2 write fails? Thanks, --0016e6498436e85bbb04877c238b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hey guys,
=A0=A0I originally asked this on the Hector group, but no one= was sure of the answer. =A0Can I get some feedback on this. =A0I'd pre= fer to avoid having to use something like Cages if I can for most of our us= e cases. =A0Long term I can se= e we'll need to use something like Cages, especially when it comes to c= omplex operations such as billing. =A0However for a majority of our uses, I= think it's a bit overkill. =A0I've used transactions heavily in th= e workplace on SQL based app developments. =A0To be honest, a majority of a= pplication's I've built utilize optimistic locking, and only the at= omic, consistent, and durable functionality of transactional ACID propertie= s. =A0

To en= capsulate all 3, I essentially need all writes to cassandra for a given bus= iness invocation to occur in a single write. =A0With Spring, I would implem= ent my own transaction manager which simply adds all mutates and delete ops= to a batch mutate. =A0When my transaction commits, I would execute the mut= ation on the given keyspace. =A0Now this would only work if the following s= emantics apply. =A0I've tried searching for details in Cassandra's = batch mutate, but I'm not finding what I need. =A0Here are 2 use cases = as an example.

Case 1: Successful update :=A0User adds new contact

Transaction Start.
Biz op=A01. Row is creat= ed in=A0=A0"contacts" and all data is added via batch mutation
Biz op 2. Row is created for an SMS message is created for queueing =A0thro= ugh the SMS gateway
return op 2
return op 1
T= ransaction Commit (batch mutate executed)

Case 2. = Failed update: User adds new contact

Biz op 1. Row is created in "contacts"
<= div>Biz op 2. Row is created for SMS message queuing. =A0Fails due to inval= id international phone number format
return op 2
return= op 1
Transaction is rolled back (batch mutate never executed)

Now, here is where I can't find what I need = in the doc. =A0In case 1, if my mutation from biz op 2 were to fail during = a batch mutate operation encapsulating all mutations, does the batch mutati= on as a whole not get executed, or would I still have the mutation from op = 1 written to cassandra while the op 2 write fails?

Thanks,
--0016e6498436e85bbb04877c238b--