← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 3356.h

历史迁移需表达未知

理解等级:高级

状态模型迁入事件溯源时,旧数据没有完整变化史。可以推测一条回放后等于现状的事件流,但回放相等只证明结果一致,不能证明恢复了真实历史。显式迁移事件则坦承历史未知并初始化当前状态,代价是投影要长期支持该事件。应在历史可信度与永久迁移负担之间作选择。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 演进设计决策 · 查看原书依据

      The alternative approach is to acknowledge the lack of knowledge about past events and explicitly model it as an event. Instead of recovering the events that may have led to the current state, define a migration event and use it to initialize the event streams of existing aggregate instances: { "lead-id": 12, "event-id": 0, "event-type":

    参考来源

    - 位置:《Learning Domain-Driven Design》第11章《演进设计决策》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Learning Domain-Driven Design/_epub-src/OEBPS/ch11.html) - 结论依据:原文对比尽力生成历史事件与migrated-from-legacy事件,明确恢复事件遗漏和投影永久兼容的代价。 - 原始内容:The alternative approach is to acknowledge the lack of knowledge about past events and explicitly model it as an event. Instead of recovering the events that may have led to the current state, define a migration event and use it to initialize the event streams of existing aggregate instances: { "lead-id": 12, "event-id": 0, "event-type":