活动采购基础架构实施 [英] Event sourcing infrastructure implementation

查看:54
本文介绍了活动采购基础架构实施的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在应用程序中实现了事件源和CQRS模式。我受到 CQRS旅程的启发,并在其中下载了示例代码。在那里,我发现了用于事件源的整个基础结构(CommandHandlers,EventHandlers,Events,Envelopes等),但是它的代码量非常大,我无法想象我需要用于简单事件源的所有代码。 / p>

您知道一些常见的经过测试的库/裸包/项目,其中包含用于发送/注册命令,事件以及事件源代码模式中所需的一切的所有基础结构吗?还是我应该自己实施?

解决方案

一般建议不要编写自己的事件存储。当然,您可以编写自己的ES,但仅出于教育目的。对于生产系统,我建议您使用现有的ES。乍一看可能看起来很多不必要的基础结构代码,但是您很快就会发现确实需要它。 ES的最简单形式并不难,但是一旦您开始处理并发,性能等问题,它将变得更加复杂。



NEventStore 事件存储是两个众所周知的事件存储。



根据我的经验,即使您使用现有的ES,也不要低估您需要在基础结构代码上进行投资的时间。


I implement Event Sourcing and CQRS pattern in my application. I inspired by CQRS journey where I downloaded sample code. There I found whole infrastructure for Event sourcing (CommandHandlers, EventHandlers, Events, Envelopes ... etc.), but it is quite big amount of code and I can't imagine that I need all of code for my simple Event sourcing.

Do you know some common tested library/nuget package/project containing all infrastructure for sending/registering commands, events and everything what I need in Event sourcing pattern? Or should I implement it by myself?

解决方案

The general recommendation is to not write your own event store. Sure, you can write your own ES, but do it only for educational purposes. For production systems I would recommend you to use an existing ES. It might look like a lot of unnecessary infrastructure code at first but you will soon notice that you do need it. In its simplest form ES is not that hard but once you start dealing with concurrency, performance etc it will be more complicated.

NEventStore and Event Store are two well known event stores.

As a side note from my own experience, do not underestimate the time that you will need to invest on infrastructure code even if you use an existing ES.

这篇关于活动采购基础架构实施的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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