Partitioning Key vs Clustering Keys in Cassandra | Cassandra Fundamentals

Описание к видео Partitioning Key vs Clustering Keys in Cassandra | Cassandra Fundamentals

Let’s see how different partition keys and clustering keys affect the query performance of your Cassandra tables.

The way you define your Cassandra schema is very important. You should have an idea about your read and write patterns before designing the schema. This will make sure you choose the right partition and clustering keys to organize your data in disk correctly. That way, both your reads and writes can be blazing fast.

Partition key determines which partition your data ends up in. You want to keep partitions small and related data in the same partition. It’s also important to keep in mind that one query should ideally read from one partition.

Clustering key essentially determines the order of data within a partition. Think about your queries and then think about how sorting them differently will make retrieving them much quicker. For instance, if you want the most recent data in most of your queries, have a time_created field as a clustering column and order it in a descending order, so that latest timestamp data is at the top and hence easier to retrieve.

More Cassandra videos:
Cassandra Crash Course:    • Cassandra Database Crash Course  

#cassandra #database #partitionKeys

Visit me at https://irtizahafiz.com

Contact me at: [email protected]

Комментарии

Информация по комментариям в разработке