Understanding of Isolation in Cassandra Db
Asked Answered
S

1

5

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?

Stereopticon answered 25/12, 2018 at 22:31 Comment(0)
B
8

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.

Boyish answered 26/12, 2018 at 0:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.