面试碰到一个问题,搞不定

2020-12-16 22:00:43 +08:00
 luxinfl
比如说要调用 abcde 这五个微服务,调用 b 的前提是先调用 a,cde 没有这种顺序要求。最终数据要求整合。怎么才能让时延变小??
6525 次点击
所在节点    程序员
44 条回复
js8510
2020-12-18 08:45:14 +08:00
x->b and x->a pre call
got b response, retrieve a response with the real ->a call
这样 是 max(x->b, x->a pre call) + x-a round trip 的时间

如果 a processing time 短于 b 还可以。
x->b and x->a precall
b processing and then retrieve ->a response
response x

这样的时间 和 x->a round trip + a prossing time 是一样的
mitsuizzz
2020-12-18 11:57:15 +08:00
20L 是我常用的方法,之前做过清理各个服务的数据,整合各个服务备份的脚本
519718366
2020-12-18 12:01:06 +08:00
其实面试回答,cde 异步请求就完事了…
在追问你怎么异步实现,当然优先微服务框架特性,再语言特性实现
Suddoo
2020-12-23 14:08:26 +08:00
@luvroot 感觉你这个最简洁明了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/736181

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX