PLANNED MAINTENANCE

Hello, DataStax Community!

We want to make you aware of a few operational updates which will be carried out on the site. We are working hard to streamline the login process to integrate with other DataStax resources. As such, you will soon be prompted to update your password. Please note that your username will remain the same.

As we work to improve your user experience, please be aware that login to the DataStax Community will be unavailable for a few hours on:

  • Wednesday, July 15 16:00 PDT | 19:00 EDT | 20:00 BRT
  • Thursday, July 16 00:00 BST | 01:00 CEST | 04:30 IST | 07:00 CST | 09:00 AEST

For more info, check out the FAQ page. Thank you for being a valued member of our community.


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