Listen for Changes In Cassandra Datastore?

前端 未结 3 1717
深忆病人
深忆病人 2021-01-01 04:01

I wonder if it is possible to add a listener to Cassandra getting the table and the primary key for changed entries? It would be great to have such a mechanism.

Chec

相关标签:
3条回答
  • 2021-01-01 04:29

    If clients need to know about changes, the world has mostly gone to the message broker model-- a middleman which connects producers and consumers of arbitrary data. You can read about Kafka, RabbitMQ, and NATS here. There is an older DZone article here. In your case, the client writing to the database would also send out a change message. What's nice about this model is you can then pull whatever you need from the database.

    Kafka is interesting because it can also store data. In some cases, you might be able to dispose of the database altogether.

    0 讨论(0)
  • 2021-01-01 04:42

    Check out this future jira -- https://issues.apache.org/jira/browse/CASSANDRA-8844

    If you like it vote for it : )

    CDC

    "In databases, change data capture (CDC) is a set of software design patterns used to determine (and track) the data that has changed so that action can be taken using the changed data. Also, Change data capture (CDC) is an approach to data integration that is based on the identification, capture and delivery of the changes made to enterprise data sources." -Wikipedia

    As Cassandra is increasingly being used as the Source of Record (SoR) for mission critical data in large enterprises, it is increasingly being called upon to act as the central hub of traffic and data flow to other systems. In order to try to address the general need, we, propose implementing a simple data logging mechanism to enable per-table CDC patterns.

    0 讨论(0)
  • 2021-01-01 04:54

    Are you looking for something like triggers?

    https://github.com/apache/cassandra/tree/trunk/examples/triggers

    A database trigger is procedural code that is automatically executed in response to certain events on a particular table or view in a database. The trigger is mostly used for maintaining the integrity of the information on the database. For example, when a new record (representing a new worker) is added to the employees table, new records should also be created in the tables of the taxes, vacations and salaries.

    0 讨论(0)
提交回复
热议问题