Re: What is the point of counter type when we can do the same thing with int or bigint?

2016-10-17 Thread Jeff Jirsa
The only way to do this in Cassandra now is with counters - whether you add 1 or n, it's counters or ugly read before write and lightweight transactions. Counters give Cassandra the closest thing they'll ever have to vector clocks - they give the user a way to do commutative deltas in a

Re: What is the point of counter type when we can do the same thing with int or bigint?

2016-10-17 Thread Kant Kodali
Also are you saying counters are atomic? On Mon, Oct 17, 2016 at 6:43 PM, Kant Kodali wrote: > How about “Set the value 1 above what it is now" ? The same principle > should apply right? > > > > > On Mon, Oct 17, 2016 at 6:21 PM, Jeff Jirsa >

Re: What is the point of counter type when we can do the same thing with int or bigint?

2016-10-17 Thread Kant Kodali
How about “Set the value 1 above what it is now" ? The same principle should apply right? On Mon, Oct 17, 2016 at 6:21 PM, Jeff Jirsa wrote: > You cant use int/bigint to say “Set the value 2 above what it is now”, > unless you use a read to get the current value,

Re: What is the point of counter type when we can do the same thing with int or bigint?

2016-10-17 Thread Jeff Jirsa
You cant use int/bigint to say “Set the value 2 above what it is now”, unless you use a read to get the current value, then write using lightweight transactions, which have a significant performance penalty. The primary reason for this is because no individual Cassandra node is guaranteed