本文介绍了Greg Young EventStore是否支持Snapshot?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在认真考虑使用格雷格·杨(Greg Young)的 EvenStore 来实现基于事件的系统.但是,我不确定Greg Young的EventStore是否支持快照.快照是我的应用程序的关键要求,因为我们不想每次都重放所有事件以构造对象状态.

I am seriously thinking of using EvenStore from Greg Young, for implementing a system based on events. However, I am not sure whether EventStore from Greg Young supports Snapshots. Snapshots are key requirement for my application as we do not want to replay all the events to construct object state every time.

有人可以向我提供有关如何在EventStore(格雷格·杨格版)中创建快照的示例吗?

Could anybody provide me with samples on how to create snapshots in EventStore (Greg Young Version)?

推荐答案

是的,只需将它们放在流中并读取该流的第一个值即可.

Yes, just put them in a stream and read the first value of that stream.

例如:

/streams/foo
/streams/too-domainsnapshot

读取时,从快照流中读取最后一个快照,然后从其指向的版本中向前读取.

When reading read the last snapshot off snapshot stream then read forward from the version it points to.

您还可以具有许多具有许多不同快照的流.我相信普通的域包装器已经支持此功能.

You can also have many streams with many different snapshots. I believe the common domain wrappers support this already.

另外,在我们的讨论组中(在网站上链接),这可能会得到更快的答复

Also this would be answered faster likely in our discussion group (linked on website)

这篇关于Greg Young EventStore是否支持Snapshot?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 06:16