Tran Dang
Tran Dang

Reputation: 158

Does the SSTable change when I update a column?

I understand that all insert operations will come to commitlog first, and Memtable second, after that it will be compacted to SSTable.

After compaction to SSTable, I perform an update operation for an existing column. Must the SSTable be changed to update the value of that column?

Upvotes: 2

Views: 707

Answers (2)

DNA
DNA

Reputation: 42597

Answering your follow-up question: yes, and no - your values may end up in different SSTables until they are compacted, but you don't need to wait until a compaction to get the 'true' value, because the various versions of your value are timestamped, so Cassandra can return the most recent.

Upvotes: 1

DNA
DNA

Reputation: 42597

http://wiki.apache.org/cassandra/MemtableSSTable says:

Once flushed, SSTable files are immutable; no further writes may be done

Your updated value will be written to commitlog, and a memtable, and will eventually be flushed to a new SSTable on-disk. Later, this SSTable may be merged with other SSTables to form a new larger SSTable (and the old ones will be discarded) - this is the compaction stage.

Upvotes: 3

Related Questions