In this section, we will take a look at some of the internals of Cassandra including read and write paths along with some of the mechanisms used to optimize both read and write operations. The write path is fairly straightforward which appends records to a log structure providing really high throughput. The read path consists of several data structures which are used to reduce the amount of disk seeks and optimize reads.
When Cassandra initially came out, it was widely considered a write-optimized database. Whenever a client makes a write request, a coordinator node receives it. The coordinator node forwards the request to the relevant nodes based on the partition key and replication factor. The reason local writes are fast in Cassandra is because all the writes are appended to an append-only commitlog and to an in-memory structure called memtable. This doesn't require any disk seeks unlike local reads. We will take a more in-depth look at the write path...