Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to integrate cassandra with zookeeper to support transactions

I have a Cassandra cluster and Zookeeper server installed. Now I want to support transactions in cassandra using zookeeper. How do i do that.

Zookeeper creates znodes to perform read and write operations and data to and fro goes through znodes in Zookeeper. I want to know that how to support rollback and commit feature in cassandra using Zookeeper. Is there any way by which we can specify cassandra configurations in zookeeper or zookeeper configurations in cassandra.

I know cassandra and zookeeper individually how data is read and written but I dont know how to integrate both of them using Java.

how can we do transactions in Cassandra using Zookeeper.

Thanks.

like image 359
Vaibhav Singh Avatar asked Feb 22 '11 11:02

Vaibhav Singh


People also ask

Does Cassandra support transaction?

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.

Does Cassandra use ZooKeeper?

In section 5.2, the paper clearly states that Cassandra uses zookeeper for leader election, and the leader is the single source of trust for the consistent hashing ring.

What is ZooKeeper used for?

ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.

What type of database is Cassandra?

Cassandra is a NoSQL distributed database. By design, NoSQL databases are lightweight, open-source, non-relational, and largely distributed.


1 Answers

I have a Cassandra cluster and Zookeeper server installed. Now I want to support transactions in cassandra using zookeeper. How do i do that.

With great difficulty. Cassandra does not work well as a transactional system. Writes to multiple rows are not atomic, there is no way to rollback writes if some writes fail, and there is no way to ensure readers read a consistent view when reading.

I want to know that how to support rollback and commit feature in cassandra using Zookeeper.

Zookeeper won't help you with this, especially the commit feature. You may be able to write enough information to zookeeper to roll back in case of failure, but if you are doing that, you might as well store the rollback info in cassandra.

Zookeeper and Cassandra work well together when you use Zookeeper as a locking service. Look at the Cages library. Use zookeeper to co-ordinate read/writes to cassandra.

Trying to use cassandra as a transactional system with atomic commits to multiple rows and rollbacks is going to be very frustrating.

like image 68
sbridges Avatar answered Sep 17 '22 19:09

sbridges