← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 5367.b

拆表把共同写入变单写

理解等级:高级

目录服务维护产品,库存服务维护数量,若共写Product表,可把库存字段拆至以产品ID关联的Inventory表,让各服务分别拥有。先建立新表并填入旧值,再移除旧列。这样所有权清楚,却让创建删除产品必须同步库存记录,失去单表整体事务,并引入确认、故障与最终一致性选择。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 数据所有权与分布式事务 · 查看原书依据

      Splitting the database table moves the joint ownership to a single table ownership scenario: the Catalog Service owns the data in the Product table, and the Inventory Service owns the data in the Inventory table. However, as shown in Figure 9-5, this technique requires communication between the Catalog Service and Inventory Service when products are created or removed to ensure the data remains consistent between the two tables.

    参考来源

    - 位置:《Software Architecture: The Hard Parts》第09章《数据所有权与分布式事务》(来源项目: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/ch09.xhtml) - 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。 - 原始内容:Splitting the database table moves the joint ownership to a single table ownership scenario: the Catalog Service owns the data in the Product table, and the Inventory Service owns the data in the Inventory table. However, as shown in Figure 9-5, this technique requires communication between the Catalog Service and Inventory Service when products are created or removed to ensure the data remains consistent between the two tables.