知识卡片
CQRS分开命令查询
CQRS把修改状态的命令模型与读取状态的查询模型分开,二者可采用不同表示和扩展策略,并通过变更传播保持同步。读模型适合密集消费,写端保留事务约束;同步机制增加复杂性与可见延迟,不能默认查询立即看到刚写入的状态。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Data Product Management · 查看原书依据
Reading the database, compared to writing, takes a smaller amount of computing resources because fewer of those tasks have to be performed. For optimization, CQRS separates writes (commands) from reads (queries) by using two models, as illustrated in this figure. Once separated, they must be kept in sync, which is typically done by publishing events with changes. This is illustrated by the “events arrow” (the
参考来源
- 位置:《Data Management at Scale》第04章《Data Product Management》(来源项目 a19c7933-4eda-4176-aebd-30fe7e1ad292,源文件:extracted/Data Management at Scale/_epub-src/OEBPS/ch04.html)
- 结论依据:原文对separates writes (commands)的解释、约束及上下文支持本卡;内容为中文归纳,不把架构建议当作所有组织的必然规律。
- 原始内容:Reading the database, compared to writing, takes a smaller amount of computing resources because fewer of those tasks have to be performed. For optimization, CQRS separates writes (commands) from reads (queries) by using two models, as illustrated in this figure. Once separated, they must be kept in sync, which is typically done by publishing events with changes. This is illustrated by the “events arrow” (the