Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There is no rollback in Cassandra, then how does Cassandra remove failed writes?

Suppose I have a 2 node cluster with Replication Factor(RF) = 2. I fire an insert with Consistency 2. Cassandra starts to write to these 2 nodes while client is waiting for a response. In between one node fails and could not complete the write, while write on other node succeeded. Client will not get a success message as consistency cannot be met. There is no rollback in Cassandra. So how and when does Cassandra remove the inserted record from that one node or mark it as 'not to be used'?

Related Question: Does Cassandra write to a node(which is up) even if Consistency cannot be met?

like image 466
Arun Joy Thekkiniyath Avatar asked May 30 '15 08:05

Arun Joy Thekkiniyath


People also ask

Does Cassandra support rollback?

Cassandra does not use RDBMS ACID transactions with rollback or locking mechanisms, but instead offers atomic, isolated, and durable transactions with eventual/tunable consistency that lets the user decide how strong or eventual they want each transaction's consistency to be.

Is Cassandra acid compliance?

Cassandra, ACID and BASE While it does support other ACID-like features, such as strong consistency (using CL=ALL), compare-and-set updates with Lightweight Transactions, atomicity and isolation on the row-level, and has a durable writes option, it is inaccurate to describe Cassandra as an ACID-compliant database.

How to delete data from a table in Cassandra?

You can delete data from a table using the command DELETE. Its syntax is as follows − Let us assume there is a table in Cassandra called emp having the following data − The following statement deletes the emp_sal column of last row − cqlsh:tutorialspoint> DELETE emp_sal FROM emp WHERE emp_id=3;

How to back up data in Cassandra?

•Currently, the most common method for backing up data in Cassandra is using the snapshot function in the nodetool utility. This is an online operation and does not require any downtime or block any operations on the server.

Does Cassandra have a single point of failure?

Moreover, Cassandra offers linear performance increases as new nodes are added to a cluster, scales to terabyte-petabyte data volumes, and has no single point of failure. 60.How does Cassandra protect me against downtime?

What is writes to Cassandra?

That is Writes to Cassandra are atomic, isolated, and durable in nature. The “C” of ACID—consistency—does not apply to Cassandra, as there is no concept of referential integrity or foreign keys. Cassandra offers you to tune your Consistency Level as per your needs .


1 Answers

It doesn't. Cassandra will try to replicate the data on each write operation and your application will be notified if the consistency level couldn't be met. But Cassandra doesn't rollback writes.

What you probably want to do in such cases is to use a higher CL for your reads as well. E.g. using CL QUORUM will read the data from both nodes and will automatically repair data in case its missing on one of the nodes.

like image 70
Stefan Podkowinski Avatar answered Oct 26 '22 00:10

Stefan Podkowinski