On a single node Cassandra, if I perform
write(key=A, value=3)
write(key=A, value=5)
a_value = read(key=A)
would a_value
be 3, or 5? Or in other words, does Cassandra guarantee read-after-write consistency, where we always see the most recent value?
If you wait for a response, then yes. If you don't wait for a response for the write request then the read request could be handled before.
Yes, if the sequence of requests of read and write is Write-> Read. If your request is synchronous (session.execute), that means you wait for a response for your write request and after getting successful response you do the read request, then yes you'll get most recent value. Since for a single node, data is not distributed among multiple nodes thus does not have to worry about maintaining consistency.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.