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

ashok.dcosta_187920 avatar image
ashok.dcosta_187920 asked ·

What does cardinality mean in Cassandra?

What is cardinality in cassandra ? How do you define cardinality in cassandra ?

cassandraindex
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 ·

In mathematics, cardinality is the number of elements in a set or a group.

In databases, cardinality is an attribute of the uniqueness of data in a column or field.

A column which has high cardinality means that the range of values are mostly unique. An example is a column containing email addresses. It has a high cardinality since only 1 person can have each email address.

A column which has low cardinality means that it contains values that appear repeatedly. An example is a boolean column. It has a low cardinality since there are only 2 possible values -- true or false.

I assume you're asking because you probably came across it while learning about secondary indexes in Cassandra. If so, you might be interested in the document on when to use a secondary index. Cheers!

2 comments 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.

Hi Erick ,

Is the cardinality is the relationship between two tables for example Videos and actors , 1 video can have many actors and 1 actor can belong to many videos , so the cardinality is Many to Many relationship is this correct ? Or is it different in cassandra as you said above cardinality is an attrribute of uniqueness on column . I was watching the below video .

Please advise how to we define cardinality in cassandra ?

https://academy.datastax.com/units/22014-conceptual-data-modeling-practical-application-data-modeling-apache-cassandra?resource=ds220

0 Likes 0 · ·

The definition in my answer relates to Cassandra. Cheers!

On a side note, I converted your post to a comment since it's not an "answer". Please don't post comments as answers since it's confusing for new members of the community. :)

0 Likes 0 · ·