Last-write-wins conflict resolution

Under the hood, every time a piece of data is written to Cassandra, a timestamp is attached. Then, when Cassandra has to deal with conflicting data as in the scenario mentioned earlier, it simply chooses the data with the most recent timestamp. Even though the sequence of writes we discussed earlier was concurrent from the perspective of the distributed database, it's vanishingly unlikely that Cassandra received them at the exact same microsecond. So, one of them will have the more recent timestamp, and that's the one that Cassandra will return when we read the data back with the ALL consistency.

It's important to emphasize that each column has its own timestamp value; if we issue a query that only updates ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.