Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 17067 invoked from network); 9 Jun 2010 09:57:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Jun 2010 09:57:44 -0000 Received: (qmail 93945 invoked by uid 500); 9 Jun 2010 09:57:42 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 93931 invoked by uid 500); 9 Jun 2010 09:57: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 93915 invoked by uid 99); 9 Jun 2010 09:57:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jun 2010 09:57:41 +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 joolski@gmail.com designates 74.125.82.172 as permitted sender) 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, 09 Jun 2010 09:57:35 +0000 Received: by wyb32 with SMTP id 32so1481788wyb.31 for ; Wed, 09 Jun 2010 02:57: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=2h+w63tzFbD8EoC5qD+xMMccyCKNIyduo0brye/fYoo=; b=Ie58idvVlTmJYrbIyLlkftK/yPhpHoEVwA1Qeg3PVhZXZcMZW21C/qa1ghtiVkwnla M0ESP1+V6eDKxoHUdlhFOeKVaDIjCxb4U/AjkVA7s8nLmnKXDYmjNHeOVaLWzDbHbQzk DucsSYr7H5SjWdC2R2YbacxS+chFgRNegW8CI= 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=ovtZBjeKDj/t2TpoKNY8Eyba1UtX0qygHVfXNbsbEZb0kgvwkuYWZko+/MDLG+FwYY k2M0ijWZZxpV9ICUOIZ2blH0R/LF0FHhkSwgaEV79p2428bLMYGTXC3vF8GBGxlt/+NH Qx6Q5a1gAObZ1xBmRHfcw5wIPL9aUw5Wfj2hg= MIME-Version: 1.0 Received: by 10.227.133.14 with SMTP id d14mr2388769wbt.59.1276077434668; Wed, 09 Jun 2010 02:57:14 -0700 (PDT) Received: by 10.216.72.131 with HTTP; Wed, 9 Jun 2010 02:57:14 -0700 (PDT) In-Reply-To: References: <1OMH23-0003qP-UN@mail.eleven.de> Date: Wed, 9 Jun 2010 10:57:14 +0100 Message-ID: Subject: Re: Inserting new data, where the key points to a tombstone record. From: Jools To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0016e649ce743327ad048895ee4b X-Virus-Checked: Checked by ClamAV on apache.org --0016e649ce743327ad048895ee4b Content-Type: text/plain; charset=ISO-8859-1 On 9 June 2010 10:43, Sylvain Lebresne wrote: > > However, as a final point of clarification, is there a particular reason > > that insert does not raise an exception when trying to insert over an > > existing key, or when the key points to a tombstone record ? > > Inserting over an existing key is an update of the record and in the > Cassandra > data model, this is nothing exceptional, this is the normal way to do > things, > by design. > > There is however a technical reason why it would be hard to return an > exception in the case you mention. The way Cassandra does inserts, it don't > know when you insert something that another record with the same key > exists. > Writes only append stuffs. Checking that the key exists would slow down > writes > quite a bit. > > I can see there are technical, and performance reasons for not checking that a key exists. And from reading Martin's post it's clear that to make certain scenarios work as expected one needs to alter the way the data is organised. I've got plenty of pointers now to allow me to alter my datasets to cover these issues now, many thanks Martin and Sylvain for taking the time to respond. Best regards, --Jools --0016e649ce743327ad048895ee4b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On 9 June 2010 10:43, Sylvain Lebresne <= span dir=3D"ltr"><sylvain@yakaz.com= > wrote:
> However, as a final point of clarification, is there= a particular reason
> that insert does not raise an exception when trying to insert over an<= br> > existing key, or when the key points to a tombstone record ?

Inserting over an existing key is an update of the record and in the = Cassandra
data model, this is nothing exceptional, this is the normal way to do thing= s,
by design.

There is however a technical reason why it would be hard to return an
exception in the case you mention. The way Cassandra does inserts, it don&#= 39;t
know when you insert something that another record with the same key exists= .
Writes only append stuffs. Checking that the key exists would slow down wri= tes
quite a bit.


I can see there are te= chnical, and performance reasons for not checking that a key exists. And fr= om reading Martin's post it's clear that to make certain=A0scenario= s work as expected one needs to alter the way the data is organised.

I've got plenty of pointers now to allow me to alte= r my datasets to cover these issues now, many thanks Martin and=A0Sylvain f= or taking the time to respond.

Best regards,

--Jools



=A0=A0

=A0

--0016e649ce743327ad048895ee4b--