Is it better to have two separate tables for smaller size than one big table in cassandra?

Viewed 460

I have a situation where it's possible for me to either have two separate tables with the primary key consisting of two columns OR a single table with data from both the previous table where primary key is a combination of three columns.

Which option is better for read-intensive database in Cassandra.

2 Answers

Try To Create A Table Where You Can Satisfy Your Query By Reading (Roughly) One Partition

In practice, this generally means you will use roughly one table per query pattern. If you need to support multiple query patterns, you usually need more than one table. To put this another way, each table should pre-build the "answer" to a high-level query that you need to support. If you need different types of answers, you usually need different tables. This is how you optimize for reads. Remember, data duplication is okay. Many of your tables may repeat the same data.

https://www.datastax.com/blog/2015/02/basic-rules-cassandra-data-modeling

This is already answered, Cassandra - one big table vs many tables

You can use both the scenario but you need to follow best practices recommended by Datastax or Apache Cassandra. you may refer basic guideline as below:- http://cassandra.apache.org/doc/latest/data_modeling/index.html or https://www.datastax.com/blog/2015/02/basic-rules-cassandra-data-modeling

But for read intensive application you should many things such as compaction properties, table properties, indexes, partitions etc too. If your tables are going large you should take care above properties specially partitions. Hope, this will help you.

Related