Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

vijayshanker.oracle_94842 avatar image
vijayshanker.oracle_94842 asked ·

TTL with time tiered compaction for writes & updates

Hi,

Is there any difference in the read path if a row is inserted with 10 minute TTL and GC_GRACE as 1 hour when the row is inserted with same partition key and the same partition key row is updated in terms during compactions running where a row is in 1 sstable and before compaction same row is inserted in to another sstable?

Also when there is no clustering column will the data stored would be arranged by latest time stamp for same row before and during compaction?


cassandraread path
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

@vijayshanker.oracle_94842 Your question isn't very clear to me so I'll try my best to answer.

When data is written in parts and updated, it doesn't matter if parts of a partition are fragmented across SSTables -- all of the fragments get coalesced (serialised) from all sources including memtables and SSTables. Say there are 2 versions of a partition. The version which has the newest write timestamp always wins. If you did an INSERT with a TTL then 2 seconds later did another INSERT (UPDATE is also an INSERT under-the-hood in C*) withOUT a TTL, the new mutation will be the "winning" version and will be returned by a SELECT.

For more info, see the following documents:

If you provide some sample CQL queries illustrating your question, I'd be more than happy to update my response. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.