how to integrate cassandra with zookeeper to support transactions

前端 未结 4 1020
夕颜
夕颜 2021-01-02 00:45

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 znod

4条回答
  •  耶瑟儿~
    2021-01-02 01:04

    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.

提交回复
热议问题