听听Cassandra数据存储区的变化? [英] Listen for Changes In Cassandra Datastore?

查看:157
本文介绍了听听Cassandra数据存储区的变化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以为Cassandra添加一个监听器来获取表和更改条目的主键?拥有这样的机制会很棒。

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.

检查Cassandra文档我只发现将StateListener添加到Cluster实例。

Checking Cassandra documentation I only find adding StateListener(s) to the Cluster instance.

有没有人知道怎么做而不用黑客攻击Cassandras数据存储或封装驱动程序并自己做点什么?

Does anyone know how to do this without hacking Cassandras data store or encapsulate the driver and do something on my own?

推荐答案

如果客户需要了解变化,那么世界大多数都转向消息代理模型 - 一个连接生产者和消费者任意数据的中间人。你可以阅读有关Kafka,RabbitMQ和NATS的信息这里。有一篇较旧的DZone文章此处。在您的情况下,写入数据库的客户端也会发送更改消息。这个模型有什么好处,你可以从数据库中提取你需要的任何东西。

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很有意思,因为它也可以存储数据。在某些情况下,您可以完全处置数据库。

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

这篇关于听听Cassandra数据存储区的变化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆