J Oliver EventStore V2.0 CommonDomain 快照

发布于 2024-11-03 02:22:21 字数 76 浏览 3 评论 0原文

使用 EventStore 和 CommonDomain 时拍摄聚合快照的最佳实践是什么(是否有更好的地方可以询问,用户组,类似的东西)?

Whats considered best practice to take Snapshots of the aggregates when using EventStore and CommonDomain (Is there a better place to ask, usergroup, something like that) ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

指尖上的星空 2024-11-10 02:22:21

Stack Overflow 是提问的最佳场所,因为每个人都可以从答案中受益。

快照通常应在“带外”获取,即在处理主线之外。换句话说,当提交一系列事件时,您不想在此时拍摄快照。相反,您需要让另一个线程或进程异步拍摄快照。我建议使用另一个线程而不是完全独立的进程,因为您不必担心确保程序集(域、消息等)与主处理线程的程序集相同。

“如何”拍摄快照的代码由最终用户决定。我很可能会在下周左右提供一些关于拍摄快照的确切步骤的额外指导。

另一项考虑是,您真的需要快照吗?您有多少个事件超过 1000 个的流?如果没有,那么您几乎肯定不需要复杂的快照。

Stack Overflow is the best place for questions because everyone can benefit from the answers.

Snapshots should generally be taken "out of band"--that is out of the mainline of processing. In other words, when a series of events are being committed, you don't want to take a snapshot at that point. Instead, you'll want to have another thread or process take a snapshot asynchronously. I recommend another thread instead of a completely separate process because you don't have to worry about making sure your assemblies (domain, message, etc.) are the same as that for your main processing threads.

The code for "how" to take a snapshot is left up to you, the end user. I will very likely provide some additional guidance in the next week or so on the exact steps for taking a snapshot.

One additional consideration is, do you really need snapshotting? How many streams do you have that go above 1000 events? If none, then you almost certainly don't need the complexity of snapshotting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文