Tutorial by Examples

Cassandra uses two kinds of keys: the Partition Keys is responsible for data distribution across nodes the Clustering Key is responsible for data sorting within a partition A primary key is a combination of those to types. The vocabulary depends on the combination: simple primary key: only...
Declaring a key The table creation statement should contain a PRIMARY KEY expression. The way you declare it is very important. In a nutshell: PRIMARY KEY(partition key) PRIMARY KEY(partition key, clustering key) Additional parentheses group multiple fields into a composite partition key or de...
The partition key is the minimum specifier needed to perform a query using a where clause. If you declare a composite clustering key, the order matters. Say you have the following primary key: PRIMARY KEY((part_key1, part_key_2), (clust_key_1, clust_key_2, clust_key_3)) Then, the only valid qu...

Page 1 of 1