How does Cassandra resolve conflicts between concurrent writes, and what is the last-write-wins model?
Last updated
Last-write-wins (LWW): each cell carries a microsecond timestamp, and on conflict the highest timestamp is kept during reads, compaction, and read-repair. No locking or merging.
Resolution is per column, so concurrent updates to different columns both survive. Clock skew can let an older write win, so sync clocks with NTP.
For compare-and-set semantics without blind overwrites, use lightweight transactions (
IFconditions, Paxos).
- https://cassandra.apache.org/doc/stable/cassandra/architecture/dynamo.html
- https://docs.datastax.com/en/hyper-converged-database/2.0/drivers/timestamps.html
- https://goodspace.ai/interview-questions/cassandra
- https://www.wecreateproblems.com/interview-questions/cassandra-interview-questions
- http://jakubdziworski.github.io/java/cassandra/database/2022/11/22/cassandra-updates-ordering.html
- https://medium.com/@shubham.patel191295/cassandra-for-system-design-interviews-when-to-pick-it-how-it-shards-and-every-question-youll-5542335def0e
- https://arpitbhayani.me/blogs/cassandra-writes/
- https://dev.to/danyson/last-write-wins-a-conflict-resolution-strategy-2al6