Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Write conflict resolution in cassandra

Tags:

cassandra

I understand that cassandra resolves writes conflicts based on every column's key-value pair's timestamp (last write wins). But is there a way we can override this behavior by manual intervention?

Thanks,

Chethan

like image 450
Chethan Suresh Avatar asked Feb 17 '23 02:02

Chethan Suresh


1 Answers

No.

Cassandra only does LWW. This may seem simplistic, but Cassandra's Big Query-esque data model makes it less of an issue than in a pure key/value-store like Riak, for example. When all you have is an opaque value for a key you want to be able to do things like keeping conflicting writes so that you can resolve them later. Since Cassandra's rows aren't opaque, but more like a sorted map, LWW is almost always enough. With Cassandra you can add new cells to a row from multiple clients without having to worry about conflicts. It's only when multiple clients write to the same cell that there is an issue, but in that case you usually can (and you probably should) model your way around that.

like image 106
Theo Avatar answered Feb 24 '23 08:02

Theo