Right now I have a table with three columns:
Data, with first two defined as partition key.
Currently it works as desired: if
ObjectId match existing row, it gets overwritten.
I’m trying to add sorting by date, so I added third column,
LastModified and specified it as clustering key. While it works for sorting, now I have multiple rows sharing the same
ObjectId pairs, which is not what I need.
How can I achieve previous behaviour?
- I could read table before writing and delete matching row before writing a new one.
- I could, after reading, filter rows in my application.
I dislike both solutions because they seem to be too complicated and performance is a big concern. Is there a better way?