Question-: Which of the following statement is correct with regards to write consistency? A. Write to first replica and the replica crashes one second later. The other messages are not delivered. The data is lost. B. Write to first replica and the operation times out. Future reads can return the old or the new value. You will not know the data is incorrect. C. Write to first replica and one of the other replicas is down. The node comes back online. The application will get old data from that node until the node gets the correct data or a read repair occurs. D. Write at QUORUM and then a read at QUORUM. One of the replicas dies. You will always get the correct data.
Answer: A, B, C, D Exp: All below are correct.
- Write to first replica and the replica crashes one second later. The other messages are not delivered. The data is lost. - Write to first replica and the operation times out. Future reads can return the old or the new value. You will not know the data is incorrect. - Write to first replica and one of the other replicas is down. The node comes back online. The application will get old data from that node until the node gets the correct data or a read repair occurs. - Write at QUORUM and then a read at QUORUM. One of the replicas dies. You will always get the correct data.
Admin and Dev both
Question-: Which of the following is correct for transactions in Cassandra? A. Cassandra offers atomic, isolated and durable transaction with eventual and tunable consistency. B. Cassandra does not support consistency in ACID sense. C. Cassandra support atomicity and isolation at row-level. D. Inserts or updates of more than two rows in the same partition are treated as one write operation. E. Delete operation is not atomic at partition level.
Answer: A, B, C, D Exp: Cassandra database does not follow ACID (Atomicity, Consistency, Isolation and Durability) and also having both Rollback and locking mechanism. However, Cassandra offer the atomic, isolated and durable transactions with eventual and tunable consistency.
In Cassandra there is no support for joins, foreign keys etc. A write operation in Cassandra is atomic at partition level, it means if we are inserting or updating two or more rows in the same partition then it will be treated as one write operation. Similarly delete operation is also atomic at partition level.
Admin and Dev both
Question-: Suppose you have setup the consistency level as QUORUM with the replication factor as , which of the following statements are correct? A. Database replicates the write to all nodes in the cluster and waits for acknowledgement from two nodes. B. If the write fails on one node and succeeds on another node, Cassandra will repot as a failure. C. If the write fails on one node and succeeds on another node, then replicated write that succeeds on the other node will be rolled back. D. If the write fails on one node and succeeds on another node, then replicated write that succeeds on the other node will not be rolled back.
Answer: A, B, C Exp: As we know in Cassandra DB write operations are atomic at partition level. It means more than 1 update or inserts in the same partition are treated as one write operation. Similarly delete operation is treated as atomic.
Suppose we are using write consistency as QUORUM and having replication factor as 3. While writing database will wait for acknowledgement from two nodes at least. If any of the one replica write fails. Cassandra will consider it as a failure and replica written on the other node will be rollbacked.
Cassandra uses client-side timestamp to determine the most recent update to a column. The latest timestamp always wins when requesting the data, so if multiple client sessions update the same columns in a row concurrently, the most recent update is the one seen by readers.