Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Cassandra handles concurrent updates?

Tags:

cassandra

acid

How does Cassandra handle concurrent updates to the same key by multiple users? Does Cassandra follow the "Isolation" property from ACID?

like image 444
sras Avatar asked Nov 16 '15 09:11

sras


2 Answers

While not truly ACID compliant, Cassandra enforces row-level isolation:

For example, if one user was writing a row with two thousand columns, another user could potentially read that same row and see some of the columns, but not all of them if the write was still in progress.

Full row-level isolation is in place, which means that writes to a row are isolated to the client performing the write and are not visible to any other user until they are complete.

As for competing writes handled by different coordinator nodes, each column value contains a write-time value indicating when it was written. This ensures that the most-recent write to a column occupies the cell. In other words "last write wins."

like image 180
Aaron Avatar answered Sep 28 '22 06:09

Aaron


Cassandra provides atomicity and isolation guarantees for row-level updates. You can read more about it in the datastax blog article.

like image 42
Stefan Podkowinski Avatar answered Sep 28 '22 06:09

Stefan Podkowinski