stkUser
stkUser

Reputation: 125

When does Cassandra acknowledgement the write?

Does Cassandra acknowledges write as soon as it writes to commit log?or does it wait for the write to be written to the memtable also in order to send success to client?

Upvotes: 1

Views: 452

Answers (2)

ans_ak
ans_ak

Reputation: 21

Write success occurs when data is written to commitlog and memtable. Again for multi node cluster with rf > 1 , it depends on the consistency level you set for writes.

Upvotes: 1

Alex Ott
Alex Ott

Reputation: 87164

Per DSE Architecture guide:

The write consistency level determines how many replica nodes must respond with a success acknowledgment for the write to be considered successful. Success means data was written to the commit log and the memtable.

And it makes sense, because it may not be possible to write data to the memtable, for example, if all memtables are still flushing, and there is no space left for a new write - in this case, Cassandra will return error. And writing to commit log just lowers the chance that you lose the data if machine lose power, or process crashes.

Upvotes: 0

Related Questions