Distributed Counter pattern
Whenever there is a need to maintain counters in applications that need to be persisted and distributed, use the Cassandra Counter data type in the column families. The distributed counter value is 64-bit long, supporting only two operations, namely increment and decrement. This is much better than storing the counter values in RDBMS tables, caches, log files, text files, and so on. In the latest version of Cassandra, the performance of the Counter data type has been improved a lot, and many issues have been fixed to allow it to support very powerful use cases.
Motivations/solutions
The need to use counters exists in most applications. If the application and the database lives in just one node, there is no issue and everything is hunky-dory. The moment any one of these components gets distributed across multiple nodes, the pain begins. Then the need for synchronization arises, and the external synchronization tools such as Zookeeper come into the solution stack...