DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

Gangadhara M.B avatar image
Gangadhara M.B asked ·

What is the best way to get a record count of a table in Cassandra?

what is the best and most accurate way to get record count in a Cassandra table with multi node Apache Cassandra version 3.11.6 cluster with replication factor of 3 ,

cassandracountdsbulk
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

Performing a CQL COUNT() has always been problematic in Cassandra not because it isn't capable but more a challenge inherent in its distributed architecture. I've written about this problem in detail in a blog post, Counting keys? Might as well be counting stars.

Luckily, we now have the DataStax Bulk Loader (dsbulk tool) to the rescue. Primarily designed as a more efficient tool for bulk loading data in CSV or JSON format to a Cassandra cluster, the Bulk Loader is also features the ability to perform a distributed count of records in a table.

Here are the key references on the Bulk Loader tool:

Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.