Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How inefficient is update counter in cassandra compared to standard insert operations?

Tags:

cassandra

I read Tyler Hobbs's guide to basic modelling in cassandra, here https://www.datastax.com/dev/blog/basic-rules-of-cassandra-data-modeling and I notice the 1st footnote that said counter is exception to how cheap cassandra write is.

What's so inefficient about cassandra counter is ?

like image 836
Dimas Rizky Avatar asked Jan 17 '26 09:01

Dimas Rizky


1 Answers

check this and this to understand.

One statement regarding counter performance in above link:

The new implementation does come with a price. Because we perform a mutexed read-before-write now, latency for CL.ONE (or RF=1) to would suffer with a naive implementation, particularly for many updates contenting for few counter objects. To mitigate this, Cassandra 2.1 introduces a new form of cache, counter cache, to keep hot counter values performant. Counter cache size and save period can be configured in cassandra.yaml.

like image 136
Laxmikant Avatar answered Jan 21 '26 04:01

Laxmikant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!