Using a counter
A counter is a special column for storing a number that is changed in increments.
A counter is a special column used to store a number that is changed in increments. For example, you might use a counter column to count the number of times a page is viewed.
Apache Cassandra™ 2.1 counter column improves the implementation of counters and provides a number of configuration options to tune counters. In Cassandra 2.1 and later, you can configure how long the coordinator can wait for counter writes to complete, the size of the counter cache in memory, how long Cassandra waits before saving counter cache keys, the number of keys to save, and concurrent_counter_writes. You set the options in the cassandra.yaml file.
Define a counter in a dedicated table only and use the counter data type. You cannot index, delete, or re-add a counter column. All non-counter columns in the table must be defined as part of the primary key.
To load data into a counter column, or to increase or decrease the value of the counter, use the UPDATE command. Cassandra rejects USING TIMESTAMP or USING TTL in the command to update a counter column.