educative.io

Why is the write successful AFTER the data is written to MemTable

Why is the write successful AFTER the data is written to MemTable, isn’t the commit log sufficient (I imagine the write to MemTable can by asynchronous)?


Type your question above this line.

Course: https://www.educative.io/collection/5668639101419520/5559029852536832
Lesson: https://www.educative.io/collection/page/5668639101419520/5559029852536832/4540447085559808

According to this blog

The main aim of the commit log is to track all data that has not been written to disk i.e. data in a memtable which has not been flushed to disk.

Commit-log is only considered as a backup of MemTable and only be used when restart a crashed server. Cassandra reads MemTable for unflushed data, not the commit-log. Therefore, if we ack after commit-log and before MemTable, the next read might not get the acked entry (not found).