1

I understand that basic stats in the read model can be computed on the fly as events from the domain model are generated. Does this really work for more complicated situations? What happens if new stats are required in the future - do you run past events against the new read model retrospectively? Any feedback related to reporting and cqrs would be very much appreciated.

4

1 回答 1

3

我想您在谈论事件溯源,因为 CQRS 并不一定意味着您正在存储事件。

在事件溯源的情况下,是的,您可以删除整个读取模型并从过去的事件中对其进行补充。事件溯源的想法是,您的事件流是所有发生的事情的日志。

读取模型只是这些事件的投影。当您的见解发生变化(或为此添加预测)时,可以更改该预测。这是事件溯源的一大优势。

于 2014-06-01T21:20:43.807 回答