Understanding how Cassandra handles writes is key to knowing how to build applications on top of it. The following is a high-level diagram of how the Cassandra write path works:
Figure 2.3: An illustration of the Cassandra write path, showing how writes are applied both to in-memory and on-disk structures
When a write operation reaches a node, it is persisted in two places. There is an in-memory structure known as a memtable, which gets the write. Additionally, the new data is written to the commit log, which is on-disk.
The commit log is Cassandra's way of enforcing durability in the case of a plug-out-of-the-wall event. When a node is restarted, the commit log is verified against what is stored on-disk and replayed if necessary.
Once a flush of the memtable is triggered, the data stored in memory is written to the sorted string table files ...