From the course: Cassandra Data Modeling Essential Training
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Primary keys and secondary indexes - Cassandra Tutorial
From the course: Cassandra Data Modeling Essential Training
Primary keys and secondary indexes
- [Instructor] An important consideration in data modeling is selecting the appropriate primary key. The key will uniquely identify a row, but it will also limit how we can retrieve rows. We need to carefully consider the implications of our primary key choice. For example, let's assume that the process ID and host ID uniquely identify an application instance. In this example, we have three text attributes followed by three int or integer attributes. The text attributes are application name, process ID, and host ID. The integer attributes store data on operating system priority, CPU time and number of IO operations. You'll notice that the first column in the primary key is host ID. This is because the first column specified in the primary key is used as the partition key. The partition key determines which node the row is stored on. The rest of the primary key is used as the clustering key which determines how data is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.