知识卡片
CQRS分开读写模型
CQRS 将命令与查询拆成不同模型,二者可按各自负载独立扩容,也可分别选择缓存、队列与存储;它不强制使用两种存储技术。代价是模型和代码路径增多,还须处理数据同步,适合读写需求明显不同的场景。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Principles of Software Architecture Modernization》第2章《Anti-Patterns: Lack of Isolation》(源文件:`_epub-src/OPS/ch02.xhtml`,归一化正文 [21116:25342))
- 结论依据:原文指出 CQRS 分开命令和查询,允许不同结构与运行资源,并说明存储技术相同而节点不同也可实现读写隔离。
- 原始内容:Because CQRS separates commands and queries, different structures, classes and potentially code bases are necessary. This pattern allows better scalability of the system because different models can run on different hardware, for instance, scaling reads and writes in a different way. CQRS can be combined with caching technologies, queue systems, and persistence storage.