知识卡片
稳定数据逻辑宜用共享库
三个工单服务共享查询更新代码,但历史记录表明它变化很少。若抽为数据服务,每次读写多一个远程跳转,还增加扩展协调、故障传播和运行时升级风险;集中连接池在多实例下优势也有限。采用可版本化共享库能保留直接调用与服务自主发布,代价是每服务管理连接池、升级时自行测试部署。结论取决于稳定性与调用路径,不能据此否定所有数据服务。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 复用模式 · 查看原书依据
We found that the common database logic code does not change much and is therefore fairly stable code. Furthermore, change is less risky for the common database logic because services would need to be tested and redeployed. If changes are needed, we will apply versioning where appropriate so that not all services need to be redeployed when the common database logic changes.
参考来源
- 位置:《Software Architecture: The Hard Parts》第08章《复用模式》(来源项目:book-sources;源文件:extracted/Software Architecture The Hard Parts Modern Trade-Off Analyses for Distributed Architectures (Neal Ford, Mark Richards, Pramod Sadalage etc.)/_epub-src/OEBPS/ch08.xhtml)
- 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。
- 原始内容:We found that the common database logic code does not change much and is therefore fairly stable code. Furthermore, change is less risky for the common database logic because services would need to be tested and redeployed. If changes are needed, we will apply versioning where appropriate so that not all services need to be redeployed when the common database logic changes.