AlexGad
AlexGad

Reputation: 6692

Appropriate Use of Supercolum in Schema

I need to track versions of data in Cassandra. I was thinking that the Version # would be a super column, the entity id would be the row id and then the columns I need to track would be the columns. So, for example, version 1 of entity would be:

When querying, the most common request will be

Of lesser importance, would be queries such as:

So is the above approach with supercolumns the best approach or is there a better schema to accomplish the above. Are there caveats to using/querying supercolumns that I need to be aware of?

Upvotes: 3

Views: 119

Answers (1)

rs_atl
rs_atl

Reputation: 8985

First, do not use supercolumns. They are effectively deprecated and have many drawbacks. In your model you can easily replace your supercolumns with composites by using a composite key with two components, the first being your UUID and the second being your version. All your queries will be supported by this model. Check this out for more information on composites.

Upvotes: 4

Related Questions