知识卡片
早发送晚接收减少等待
协调层可先发出相互独立的调用,在等待回应期间处理其他工作,到真正需要数据时再读取结果。三个API若没有前后依赖,先全发再组合可增加结果已就绪的机会。这个原则只适用于可并行工作,不应把依赖前一步结果的操作机械同时发出;集成中间件的价值之一是直接支持这种异步协调。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 宏观架构中的协调 · 查看原书依据
A key advantage of centralized coordination middleware is first-class support for asynchronous calls, where we call a service but can do other work until the response comes. This approach provides superior latency and performance. If you are using this approach, send data as early as possible and ask for information as late as possible (don’t ask for information but get the information holder to send it proactively). As mentioned in Chapter 3, this maximum is called “Send Early, Receive Late, Don’t Ask but Tell.” For example, say we call three APIs and then process and combine the results.