Hello,

Do people use counters when they want to have idempotent operations in
cassandra?

I have a use case for using a counter to check for a count of objects in a
partition. If the counter is more than some value then the data in the
partition is moved into two different partitions. I can't work out how to
do this splitting and recover if a problem happens during modification of
the counter.

http://www.ebaytechblog.com/2012/08/14/cassandra-data-modeling-best-practices-part-2explains
that counters shouldn't be used if you want idempotency. I would
agree, but the alternative  is not very elegant. I would have to manully
count the objects in a partition and then move the data and repeat the
operation if something went wrong.

It is less resource intensive to read a counter value to see if a partition
needs splitting then to read all the objects in a partition. The counter
value can be stored in its own table sorting in descending order of the
counter value.

Does anybody else use another technique for achieving this idempotency with
counters?

I'm using cassandra 2.0.7.



Thanks

Jabbar Azam

Reply via email to