incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Mischo <jmis...@quagility.com>
Subject Re: Incr/Decr Counters in Cassandra
Date Wed, 04 Nov 2009 22:31:43 GMT
incr/decr actually fit with EC, since they're just add n or sub n ops  
that can be replayed in any order...it's just less costly to do it as  
a get and incr or get and decr than as separate operations...the only  
difference between a get on the value followed by an incr is the  
overhead of the additional request, so it just seems to make a lot  
more sense to make it a single call.  It's done in the SQL world a  
lot, and it's just good form, since a lot of times you're going to see  
an incr or decr tied to a get with a counter (but not  
always...sometimes you'll see just a get or an incr or decr...if you  
just have incr or decr return the new value, that works just as well,  
and the client can decide whether or not to discard the value).

On Nov 4, 2009, at 4:09 PM, Bill de hOra wrote:

> incr/decr for counters maybe doesn't fit with EC (as you might need  
> a global lock for some use cases ), but plus/minus are slightly  
> different as they're commutative and don't require a total ordering.
>
> Bill
>
> Michael Greene wrote:
>> This has come up before at http://markmail.org/thread/ 
>> w3mrh4h64xpf3vuj
>> and http://markmail.org/message/vnmsuddlrhaziq7g
>> I am in favor of adding eventually-consistent atomic operations such
>> as this, but I'm not sure how one would implement it.  Some sort of
>> UUID + bloomfilter for the individual atomic operations?  I tend to
>> think "retrieve and increment" as requested by Jon is at odds with
>> eventual consistency, but maybe I'm wrong.
>> Michael
>> On Wed, Nov 4, 2009 at 3:51 PM, Bill de hOra <bill@dehora.net> wrote:
>>>
>>> Chris Goffinet wrote:
>>>> Hey,
>>>>
>>>> At Digg we've been thinking about counters in Cassandra. In a lot  
>>>> of our
>>>> use cases we need this type of support from a distributed storage  
>>>> system.
>>>> Anyone else out there who has such needs as well? Zookeeper  
>>>> actually has
>>>> such support and we might use that if we can't get the support in  
>>>> Cassandra.
>>> I tend to need a generalization on incr/decr which is plus/minus  
>>> (eg for
>>> quota management). Having these in Cassandra would be great.
>>>
>>> Bill
>>>
>


Mime
View raw message