Cassandra table with multiple counter columns

I was wondering if it was nice (in terms of performance) to have multiple counters in the same table / columnfamily in Cassandra? My current setup is this:

CREATE TABLE IF NOT EXISTS contentCounters ( downvotes counter, comments counter, upvotes counter, contentid uuid, PRIMARY KEY (contentid) ); 

But I'm not sure if it’s good in terms of performance to have multiple counters in the same table. I used to have 3 tables with counters (tracking upvote, downvote and comment counts), but I would like to combine them all with the above hierarchy to allow quick queries of this table to get these values ​​(since this is my use case).

Any recommendations would be greatly appreciated.

Many thanks,

+7
cassandra
source share
1 answer

I do not think this should be a problem. Cassandra does not update entire strings . The "row" itself is not blocked during updates, but based on this article for version 2.1+, only the counter column in the UPDATE statement identifies the specified section key.

Version 2.1+ provides higher performance than previous versions. More here

+3
source share

All Articles