Cassandra hard
Cassandra uses Last-Write-Wins (LWW) based on microsecond timestamps. If two distinct clients write conflicting values to the same cell with the *exact* same timestamp, how is state convergence achieved?
- A The database keeps both versions and marks the row as 'Conflicted'.
- B The conflict remains forever; half of the nodes will see Value A and half will see Value B.
- C Deterministic Lexicographical Tie-breaker: If timestamps are identical, Cassandra compares the bytes of the values themselves. The value that is larger (in a byte-by-byte comparison) is chosen as the winner on all nodes.
- D The node with the lowest IP address is the final authority.
Answer: C. Deterministic Lexicographical Tie-breaker: If timestamps are identical, Cassandra compares the bytes of the values themselves. The value that is larger (in a byte-by-byte comparison) is chosen as the winner on all nodes.
Distributed convergence ('Eventual Consistency') requires that every node reaches the same result without talking to others. By having a deterministic 'Tie-breaker' (larger byte value wins), Cassandra ensures that after repairs, every node in the world will contain the exact same version of the data.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In a Cassandra Keyspace, what does a 'Replication Factor of 3' specifically guarantee for your data redundancy?
- Unlike a Leader-Follower architecture (like MySQL or Redis), how does Cassandra maintain high availability within its node cluster?
- Cassandra Query Language (CQL) looks similar to SQL. What is a fundamental SQL feature that CQL does NOT support to ensure distributed performance?
- What is the critical architectural function of the 'Partition Key' in a Cassandra table?
- Apache Cassandra is fundamentally designed as which architectural category of NoSQL database?
- An extreme financial trading application requires 'Batch' sync for the Commit Log. What is the fundamental throughput limitation introduced by this setting?