Static Column Family in Cassandra vs Dynamic Column Family?

1.5k views Asked by At

I have started working with Cassandra and I was going through Static column family and Dynamic column family and I am wondering when do we use static column family as compared to dynamic column family?

In my use case, I will be having huge JSON document, that I need to store into Cassandra. So I was thinking to use dynamic column family for that. But before that I wanted to understand more about the differences between the column families?

Can anyone highlight some differences between those and when to use what?

1

There are 1 answers

0
Chris Gerken On

Static column families are analogous to regular relational tablee where the table's key corresponds to the column family's rowkey and each of the other columns in the table have their on key/value pair in the column family.

Dynamic column families are more for time series use cases, where there is an arbitrary number of key/value pairs to store for each rowkey. The column names in this case are usually timestamps, but they can have other meanings depending on the use case. An example would be a column family for tweets. Each row contains the tweets for one user whose twitter handle is the row key. Each key value pair has a column name equal to the tweet's timestamp (or maybe tweet ID) and the value is a composite value made up of all of the tweet's attributes.