Cassandra recommends modeling data around queries. However, if I model the column as a clustering column for sorting on it, and if this object is dynamic because it is a clustered column, I cannot update its value, since now it refers to the primary key for this table. In this case, two parameters:
- Client side sorting (which is bad)
- Delete a full line and insert a new line (which will create a tombstone)
Is there another effective way to achieve this in Cassandra data modeling?
Eg. I have table_A and for requesting to get all rows with a certain state table_A_by_state. However, since the state will be dynamic, and you will need to update the state in the table_A_by_state, which comes with the options mentioned above. Has someone else encountered the same problem, or is there another way to model the data for this problem?
TABLE_A: Columns: id (K), name, state
table_A_by_state: Columns: id (K), state (C), name
database cassandra data-modeling
pratsJ
source share