本文介绍了EventStore基础知识-事件元数据/元数据与事件数据之间有何区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我非常开始使用/了解 EventStore 或get-event-store在这里知道.

I'm very much at the beginning of using / understanding EventStore or get-event-store as it may be known here.

我已经使用了有关客户,预测和订阅的文档,并准备开始在一些内部项目中使用

I've consumed the documentation regarding clients, projections and subscriptions and feel ready to start using on some internal projects.

我无法完全克服的一件事-是否有指南/建议集来描述事件元数据和数据之间的差异?我知道概念上的差异;事件数据是域的核心",用于描述的元数据,但是它变得很有哲理.

One thing I can't quite get past - is there a guide / set of recommendations to describe the difference between event metadata and data ? I'm aware of the notional differences; Event data is 'Core' to the domain, Meta data for describing, but it is becoming quite philisophical.

我想知道是否存在关于实施(查询等)的硬性规则.

I wonder if there are hard rules regarding implementation (querying etc).

非常感谢收到任何指导!

Any guidance at all gratefully received!

推荐答案

我将与您分享我的经验,这可能会有所帮助.我一直在玩akka-persistence,akka-persistence-eventstore和eventstore. akka-persistence以二进制格式存储事件包装器PersistentRepr.我想要JSON中的数据,以便可以:

I will share my experiences with you which may help. I have been playing with akka-persistence, akka-persistence-eventstore and eventstore. akka-persistence stores it's event wrapper, a PersistentRepr, in binary format. I wanted this data in JSON so that I could:

  • 使用预测
  • 使这些事件可轻松用于其他任何技术

您可以为akka-persistence-eventstore实现自己的序列化,但这仍然只能存储将我的事件嵌入到有效负载属性中的包装器.其他属性都是针对akka-persistence的. akka-persistence-eventstore的作者给了我一些很好的建议,让序列化器将有效负载存储为Data,其余存储为MetaData.这样,我的活动现在仅是业务数据,而元数据则有助于将其放在首位的技术.现在,我的投影无需解析元数据即可获得有效负载.

You can implement your own serialization for akka-persistence-eventstore to do this, but it still ended up just storing the wrapper which had my event embedded in a payload attribute. The other attributes were all akka-persistence specific. The author of akka-persistence-eventstore gave me some good advice, get the serializer to store the payload as the Data, and the rest as MetaData. That way my event is now just the business data, and the metadata aids the technology that put it there in the first place. My projections now don't need to parse out the metadata to get at the payload.

这篇关于EventStore基础知识-事件元数据/元数据与事件数据之间有何区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 02:31