cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From E S <>
Subject Re: Achieving isolation on single row modifications with batch_mutate
Date Wed, 01 Dec 2010 03:57:30 GMT
I'm a little confused about #3.  Hopefully this clarifying question won't turn 
the one maybe into a no :).

I'm fine not reading the latest data, as long as on each individual read I see 
all or none of the operations that occurred for a single one row batch_mutate.

My concern is do I have to lock the reads until they have propagated to all 
nodes.  If I do a batch_mutate with a consistency of ONE onto one row, during 
the write operation to the one node a reader can see partial changes.  Once the 
batch mutate completes, the change has not been propagated to the other nodes. 
 On a per row basis, are the changes to other nodes pushed in an isolated 
manner?  If not, it seems like I would have to write with a consistency of ALL 
and lock around that.

----- Original Message ----
From: Jonathan Ellis <>
To: user <>
Sent: Tue, November 30, 2010 9:50:51 AM
Subject: Re: Achieving isolation on single row modifications with batch_mutate

On Sat, Nov 27, 2010 at 10:12 AM, E S <> wrote:
> I'm trying to figure out the best way to achieve single row modification
> isolation for readers.

I have a lot of No's for you. :)

> As an example, I have 2 rows (1,2) with 2 columns (a,b).  If I modify both 
> I don't care if the user sees the write operations completed on 1 and not on 2
> for a short time period (seconds).  I also don't care if when reading row 1 
> user gets the new value, and then on a re-read gets the old value (within a 
> seconds).  Because of this, I have been planning on using a consistency level 
> one.
> However, if I modify both columns A,B on a single row, I need both changes on
> the row to be visible/invisible atomically.  It doesn't matter if they both
> become visible and then both invisible as the data propagates across nodes, 
> a half-completed state on an initial read will basically be returning corrupt
> data given my apps consistency requirements.  My understanding from the FAQ 
> this single row multicolumn change provides no read isolation, so I will have
> this problem.  Is this correct?  If so:
> Question 1:  Is there a way to get this type of isolation without using a
> distributed locking mechanism like cages?


> Question 2:  Are there any plans to implement this type of isolation within
> Cassandra?


> Question 3:  If I went with a distributed locking mechanism, what consistency
> level would I need to use with Cassandra?  Could I still get away with a
> consistency level of one?

Maybe.  If you want to guarantee that you see the most recent write,
then ONE will not be high enough. But if all you care about is seeing
all of the update or none of it, then ONE + locking will be fine.

> Question 4:  Does anyone know of a good c# alternative to cages/zookeeper?


Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support


View raw message