哪个NoSQL数据库可以为查询结果集提供*更改*流? [英] Which, if any, of the NoSQL databases can provide stream of *changes* to a query result set?

查看:101
本文介绍了哪个NoSQL数据库可以为查询结果集提供*更改*流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪些NoSQL数据库可以为查询结果集提供更改流?

有人可以给我指出一些例子吗?

首先,我认为没有SQL数据库提供此功能-我正确吗?

我需要能够指定任意简单的查询,这些查询在SQL中可能等效为:

SELECT * FROM accounts WHERE balance < 0 and balance > -1000;

我想要一个初始结果集:

id: 100, name: Fred, balance: -10
id: 103, name: Mary, balance: -200

但是我想一直跟随着一系列的变化,直到我停止它们:

meta: remove, id: 100
meta: add,    id: 104, name: Alice, balance: -300
meta: remove, id: 103
meta: modify, id: 104, name: Alice, balance: -400
meta: modify, id: 104, name: Alison, balance: -400
meta: add,    id: 101, name: Clive, balance: -200
meta: modify, id: 104, name: Alison, balance: -100
...

注意:我不是在谈论流大结果集.我正在寻找变化的软实时流.

此外,如果可能的话,它需要向外扩展.

谢谢

克里斯.

解决方案

尽管已经接受了一个答案,但是还有另一个答案成为您问题下假设的核心.

与获取数据更改列表有关的业务问题是什么?如果您收到了一系列事件,告诉您为什么以及数据如何更改,而不是仅仅获取数据更改列表,该怎么办?

此概念是"CQRS"作为体系结构背后的根本原因之一.基本上,您存储所有导致数据更改的事件,例如FundsDeposited,FundsWithdrawn等,您将能够重播"这些事件,不仅发现数据随时间的变化,而且还发现原因.

走这条路,您就可以将事件存储为流,并且不再局限于少数几个存储引擎.相反,您实际上可以使用任何存储引擎,它将完成工作.

Which, if any, of the NoSQL databases can provide stream of changes to a query result set?

Could anyone point me at some examples?

Firstly, I believe that none of the SQL databases provide this functionality - am I correct?

I need to be able to specify arbitrary, simple queries, whose equivalent in SQL might be written:

SELECT * FROM accounts WHERE balance < 0 and balance > -1000;

I want an an initial result set:

id: 100, name: Fred, balance: -10
id: 103, name: Mary, balance: -200

but then I want a stream of changes to follow, forever, until I stop them:

meta: remove, id: 100
meta: add,    id: 104, name: Alice, balance: -300
meta: remove, id: 103
meta: modify, id: 104, name: Alice, balance: -400
meta: modify, id: 104, name: Alison, balance: -400
meta: add,    id: 101, name: Clive, balance: -200
meta: modify, id: 104, name: Alison, balance: -100
...

Note: I'm not talking about streaming large result sets. I'm looking for a soft-realtime stream of changes.

Also, it needs to scale out, if possible.

Thanks,

Chris.

解决方案

Although an answer has been accepted, there is another answer that gets to the heart of the assumptions underneath your question.

What is the business concern that you have related to getting a list of changes to the data? What if, instead of merely getting the list of changes to the data, you received a set of events that told you why and how the data changed.

This concept is one of the fundamental reasons behind "CQRS" as an architecture. Basically you store all events that caused a change to your data, e.g. FundsDeposited, FundsWithdrawn, etc. and you gain the ability to "replay" those events and discover not just how your data changed over time, but why.

Once you go down that road, you gain the ability to store events as a stream and you are no longer limited to a small handful of storage engines. Instead you could literally use any storage engine and it would get the job done.

这篇关于哪个NoSQL数据库可以为查询结果集提供*更改*流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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