知识卡片
跨服务事务频繁提示边界过细
微服务把数据库也按服务隔离后,原先单体内易于保持原子性的操作会变成跨服务协调。若大量业务步骤总要一起提交,先检查服务粒度是否拆得过细,能否把必须共同完成的行为放回同一边界。原书同时承认例外:不同服务若确需不同架构特性而必须分离,可在权衡后采用跨服务事务模式;不能仅凭一次跨服务事务就否定拆分。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Microservices Architecture · 查看原书依据
If you’re finding that you need to wire your microservices architecture together with transactions, that’s a sign that your design is too granular.
参考来源
- 位置:《Fundamentals of Software Architecture》原书第18章《Microservices Architecture》(阅读计划第21项,单元12;源文件:`OEBPS/ch18.html`)
- 结论依据:原书建议优先修正粒度,并明确给出不同架构特性需要独立服务的例外;末句为范围限定。
- 原始内容:If you’re finding that you need to wire your microservices architecture together with transactions, that’s a sign that your design is too granular.