知识卡片
五步渐进拆库
先识别领域相关表,再把表分入各数据域schema;接着重构每个服务的连接与权限,使其只连自己的数据域,跨域访问改经服务,此时清除过渡同义词。之后把schema搬往独立服务器,最后切换连接并清除旧schema。第三步最难,因为存储过程、视图和服务中的跨域访问都须处理;只改名字不会解耦。物理迁移可备份恢复,代价通常是停机;复制后切换可减少停机,但配置与协调更复杂。
结构图:
flowchart TD
A[识别数据域] --> B[表归入域schema]
B --> C[隔离连接并替换跨域访问]
C --> D[迁移独立服务器]
D --> E[切换连接清除旧对象]
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 拆分操作数据 · 查看原书依据
In this step, the database connection logic within each service is refactored to ensure services connect to a specific schema and have read and write access to the tables belonging only to their data domain. This transition, illustrated in Figure 6-22, is the most difficult since all cross-schema access must be resolved at the service level.
参考来源
- 位置:《Software Architecture: The Hard Parts》第06章《拆分操作数据》(来源项目: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/ch06.xhtml)
- 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。
- 原始内容:In this step, the database connection logic within each service is refactored to ensure services connect to a specific schema and have read and write access to the tables belonging only to their data domain. This transition, illustrated in Figure 6-22, is the most difficult since all cross-schema access must be resolved at the service level.