cassandratransactionsatomicacid

What are the similarities and differences between a BATCH statement in Cassandra and a Transaction in SQL?


The goal of a Cassandra Batch statement is to group statements on the one partition together in a single atomic operation (all pass or fail together).

This is quite similar to how an SQL Transaction works.

To me it seems the main difference is that with an SQL Transaction, you get an ACID consistency guarantee at the end of it, which you don't necessarily get with a Cassandra Batch statement.

My question is: What are the similarities and differences between a BATCH statement in Cassandra and a Transaction in SQL?


Solution

  • Cassandra only support Atomicity and Isolation at the partition level

    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.

    As a non-relational database, Cassandra does not support joins or foreign keys, and consequently does not offer consistency in the ACID sense

    Read More : http://docs.datastax.com/en/cassandra/3.0/cassandra/dml/dmlTransactionsDiffer.html