As per the Cassandra docs Isolation in Cassandra provides row-level isolation. This means that a write to a row within a single partition on a single node is only visible to the client performing the operation.
Now I assume that in cassandra docs by write they means both Insert and Update.
My question is:
Consider a scenario where I am updating a row and at the same time other user is also updating the same row. Now because of isolation guarantee provided by Cassandra we can't be sure what will be final state of updated row.
Is my understanding about Isolation in Cassandra db as seen from the above statement correct?
The isolation means that when reading during the update the people see either the entire update to that row applied or none. ie if theres a age
and favorite_color
column in the row, and they are updating both columns, someone reading will either see the entire the old version, or the entire new version. They will not see age
as old value and favorite_color
as the new version.
writes to a row [...] are not visible to any other user until they are complete
To prevent race conditions where two updaters writing at same time is a different problem which can be solved with light weight transactions (read before write with paxos round) where only one write would "win" and the other query will report that it was not applied.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With