知识卡片

普通读书笔记卡 · 2280.p.21

默认先收窄事务范围

理解等级:高级

先找能用单数据库事务完成的方案,把事务范围限制到必要业务单元;尽可能让API幂等,再按实际性能或外部副作用需求采用复杂协调。早期用可满足需求的事务系统通常比自行实现恢复更快;外部API与界面只暴露需要的保证,避免把未来无法经济维持的强保证固化给用户。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 保持状态一致 · 查看原书依据

      Often, we can start with a simple single transaction-based system with APIs that expose only minimum guarantees and reassess our design when we redesign the system. If we thoughtlessly apply a microservices architecture, we might end up having to execute distributed transactions across databases, which we should strive to avoid. A simple single transaction-based system, even if it goes against microservices best practices, is often the quickest and easiest to implement. For more details, refer to Chapter 10.

    参考来源

    - 位置:《Software Architecture and Decision-Making》第07章《保持状态一致》(来源项目:book-sources;源文件:extracted/Software Architecture and Decision-Making Leveraging Leadership, Technology, and Product Management to Build Great Products… (Srinath Perera)/_epub-src/ch07.xhtml) - 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。 - 原始内容:Often, we can start with a simple single transaction-based system with APIs that expose only minimum guarantees and reassess our design when we redesign the system. If we thoughtlessly apply a microservices architecture, we might end up having to execute distributed transactions across databases, which we should strive to avoid. A simple single transaction-based system, even if it goes against microservices best practices, is often the quickest and easiest to implement. For more details, refer to Chapter 10.