知识卡片

普通读书笔记卡 · 3327.h

共享数据库锁住服务演化

理解等级:高级

两个服务直接读写同一数据库时,表结构重命名或存储技术替换都会要求跨服务协调;即使部署工件分开,数据层的共享契约仍阻碍独立演化。若再共享领域对象库,耦合会进一步扩散。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Principles of Software Architecture Modernization》第2章《Anti-Patterns: Lack of Isolation》(源文件:`_epub-src/OPS/ch02.xhtml`,归一化正文 [12568:16927)) - 结论依据:原文用表重命名和改用 Cassandra 的例子展示共享数据库使两个服务互相制约,证明部署拆分不足以保证独立演化。 - 原始内容:Sharing the database creates obvious isolation issues between the Profile service and Reports service. ( Figure 2.5 ) What happens if the other team changes the user profile functionality and renames the table from user to profile? Well, your user report is now broken. The same can happen from the report side. So, both services can break each other if they introduce database changes.