知识卡片
默认同步通信再按约束改异步
原书建议在可行时先用同步通信,因为设计、实现和调试通常较直接;当吞吐、弹性或可靠性要求使等待响应代价过高,再采用异步消息。异步也引入数据同步、顺序、竞态和调试难题。这个“默认”是作者的选型启发,不是禁止事件驱动;须结合调用链和业务完成语义重新判断。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Choosing the Appropriate Architecture Style · 查看原书依据
Because synchronous communication presents fewer design, implementation, and debugging challenges, we recommend defaulting to synchronous when possible, and using asynchronous communication only when necessary.
参考来源
- 位置:《Fundamentals of Software Architecture》原书第19章《Choosing the Appropriate Architecture Style》(阅读计划第22项,单元03;源文件:`OEBPS/ch19.html`)
- 结论依据:原书明确给出同步默认建议,并比较异步的收益与同步、竞态及调试代价;末句限定适用范围。
- 原始内容:Because synchronous communication presents fewer design, implementation, and debugging challenges, we recommend defaulting to synchronous when possible, and using asynchronous communication only when necessary.