2012-10-23 21:39 "@
banq"的内容
但是它的问题是走向了另外一种语言Scala ...
既然函数式语言ERLang等并发性能如此之高,为什么不干脆直接使用呢?为什么要在Java中搞出Domain事件呢?
其实函数语言的优点也是其缺点,它的不可变性导致无法动态更改内存in-memory中聚合根状态,而在业务模型统一描述中,我们也讨论了业务现实本质是有态的。
关于函数语言ErLang等的问题见这个文章:Adventures in Concurrency的讨论部分timonk所说:
Summarizer(并行计算的汇总算法) isn’t primarily engineered for optimal throughput. Instead, its main goal is keeping lots of aggregations in memory in a compact form. As long as we can update those aggregations in a timely fashion, we’re set. As far as I can tell there are many reasons erlang isn’t suited to this kind of application.
Our in-memory aggregations(内存中的聚合) are many tens of GBs (when very tightly packed) and are the fundamental shared, mutable state of the application((共享可变的状态)). Some of the individual data structures are 10s or 100s of KBs and the copying overhead from ETS to process heaps would cripple us. The limited interface of ETS isn’t particularly helpful, either.
相关帖:
探险并发
当然函数语言Scala是个例外,因为其是一个OO-FP综合体,也支持传统类型对象,其案例代码见:
Scala的event-sourced和CQRS案例代码
其他相关主题:
传统持久化方式JPA/ORM面临CQRS/Event Sourcing的挑战,见:新编程范式:面向事件的数据库
[该贴被banq于2012-11-06 11:36修改过]