znz1990
znz1990

Reputation: 39

data modelling for large numbers of column in a single row in Cassandra

I would like to use Cassandra for storing data with more than 500 columns in one row for my application which will perform quite a lot of WHERE queries. Can I perform WHERE CLAUSE without using secondary index since it's impractical to create secondary index for all columns? Or how to model the data in a better way.

Upvotes: 0

Views: 81

Answers (1)

Abdelaziz Mokhnache
Abdelaziz Mokhnache

Reputation: 4349

Cassandra is about speed and performance, it does not support joins and WHERE clause is disabled by default on non primary key columns since this filtering has a negative effect on performance.

Cassandra modeling rules are not the same as relational databases ones. In Cassandra you should model your tables according to your queries not according to your entities and relationships.

The key principles when modeling data in Cassandra are:

  • know your data.
  • know your queries
  • denormalize data.

The steps to model your data in cassandra are:

  1. Conceptual data model and Application workflow (queries)
  2. Logical data model.
  3. Physical data model.

Like it is presented in this image

I know this may have no sense for you. It is just to tell you that Cassandra modeling is different from Relational databases.

To learn more about this topic and get a solid understanding, here is a COMPLETE FREE COURSE provided by datastax company about cassandra data modeling.

Upvotes: 1

Related Questions