How is data updated?
A brief description of the write path of an update.
Inserting a duplicate primary key is treated as an upsert. An upsert writes a new record to the database if the data didn't exist before. If the data for that primary key already exists, a new record is written with a more recent timestamp. If the data is retrieved during a read, only the most recent is retrieved; older timestamped data will be marked for deletion. The net effect is similar to swapping overwriting the old value with the new value, even though Cassandra does not overwrite data. Eventually, the updates are streamed to disk using sequential I/O and stored in a new SSTable. During an update, Cassandra timestamps and writes columns to disk using the write path. If multiple versions of the column exist in the memtable, Cassandra flushes only the newer version of the column to disk, as described in the Compaction section.