Update:As of today Apache Cassandra support Counter type and it should be used instead of this custom solution. As you may already notice it is not possible to count number of rows in a column family. In fact there is a request about that in Apache Cassandra bug database. Correctly doing this in a distributed