Toggle Menu

Cassandra Data Modeling

Want to use Cassandra successfully? Your data model may be the most important factor! While Cassandra Query Language (CQL) looks like SQL, there are some key differences. Become aware of these differences so you can build a scalable data model.

Get Started


You’re using Cassandra because you want your data access to be fast and scalable. The secret to Cassandra’s fast data access is an optimized storage mechanism, which you control with the Primary Key. The primary key, and its components, tells Cassandra how to find your data quickly.

Next Concept: Primary Key

Primary Key

A Cassandra primary key uniquely identifies a row within a Cassandra table. This primary key consists of two parts: a partition key and optional clustering columns. Each of these two parts serve different and specific purposes.

Next Concept: Partition Key

Partition Key

The partition key portion of the primary key consists of one or more columns. Cassandra concatenates all values from the partition key columns and uses the result to locate quickly a partition within the cluster.

Next Concept: Partition


A partition is a set of rows (a relatively small subset of the table) that shares the same partition key. The partition is a physical unit of access, which means Cassandra will fetch all rows in a partition at the same time — very quickly. You can think of partitions as the results of pre-computed queries.

Next Concept: Clustering Columns

Clustering Columns

Within a partition, Cassandra sorts the rows using the values of the clustering columns. Therefore, during a query, Cassandra can use the clustering column values to search the partition quickly for a specific row within the partition.

Next: Skill Building

Skill Building

Want to get some hands-on experience? Give our interactive tutorials a try! You can do it all from your browser, it only takes a few minutes and you don't have to download anything.

Try It Out: Cassandra Data Modeling

Learn how to create basic Cassandra data models


So, you want to create a Cassandra schema? Cassandra's schema development methodology is different from the relational world's approach.

In this scenario, we'll learn how to create a Cassandra schema that deals with:

  • How to create tables
  • How to handle table joins
  • How to handle queries on non-primary key columns

If you are coming from a relational world, you create a schema by thinking about your data, creating a normalized model and then figuring out how to use the model in your app. Cassandra reverses this process by having you focus on queries within the app and using those queries to drive table design. We'll show you how!

Time to Complete

10-15 minutes




Continue Your Journey

Data Modeling in Apache Cassandra™

A five step process you can follow to make sure you’re designing great data models

Get The Whitepaper

DataStax Academy: Data Modeling

Our most popular online course will give you detailed experience.

Learn the Fundamentals

Data Model Meets World

When you’ve mastered the basics, check out our series on more advanced data modeling for microservice architectures.

Checkout the Series

More Resources

Material related to Cassandra Data Modeling

Data Modeling

Data Modeling Documentation

A complete example from the Apache Cassandra site.

Visit Now

DataStax Academy Course: Data Model Migration

Data Modeling

Data model and schema configuration checks

Data modeling is one of the major factors that define a project's success.

Read Now
Data Modeling

Data Modeling by Example

A growing collection of data modeling examples, from various domains.

Visit Now