liveBook · Manning

Clustering key

A clustering key is a primary-key component that orders rows within a partition.

How 2 Manning books explain it

ScyllaDB in Action

A clustering key is a primary-key component after the partition key that orders rows within a partition.

How it is used
Organizes rows within a partition so table results match query-specific ordering needs.
How deep it goes
Defines partition-local ordering, default directions, explicit CQL ordering, and the consecutive-column read rule.
Examples
Uses food reviews ordered by time and food, plus article summaries ordered by descending article ID.
What you can do after
Apply it via CQL to order partition-local results and write queries using consecutive primary-key columns.

Read how ScyllaDB in Action explains clustering key →

Spring in Action, Sixth Edition

A clustering key is the component of a Cassandra primary key that determines the ordering of rows within a partition.

How it is used
Uses clustering keys to arrange related Cassandra rows within partitions for a read-oriented data model.
How deep it goes
Defines partition placement and within-partition ordering, then demonstrates descending timestamps without detailing query-result ordering.
Examples
Demonstrates a Taco UUID partition key with createdAt as a descending clustering key.
What you can do after
Apply it via Spring Data Cassandra annotations to order rows within a chosen partition.

Read how Spring in Action, Sixth Edition explains clustering key →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.