CQRS-读取侧的事件重播 [英] CQRS - Event replay for read side

查看:89
本文介绍了CQRS-读取侧的事件重播的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了几个有关CQRS的博客,所有这些博客都解释说,在写端,事件会保留在事件存储中,并且在请求时,事件会被检索并重新播放。

I have read several blogs on CQRS and all of them explain that at write-side events are persisted on event store and upon a request, events are retrieved and replayed on aggregate.

我的问题是,为什么在读取端不需要事件重播?

My question is why doesn't event replay on an aggregate is required at read side?

推荐答案

因为您的读取侧不使用聚合。

Because your read side doesn't use aggregates.

读取侧被实现为投影,该投影根据发出的事件流计算当前状态通过聚集并将当前状态保存在某些持久存储区或内存中。读取端的while点是使客户端容易获得​​当前状态。

Read side is implemented as projections which calculate the current state from the stream of events emited by aggregates and persist the current state in some pesistent store or in memory. The while point on the read side is to have a current state readily available for clients.

这篇关于CQRS-读取侧的事件重播的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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