知识卡片
通信格式取舍要实测
选择 REST、gRPC 或其他格式时,先识别外部消费者的可接入性和内部高频调用的性能要求,再用实际载荷与流量测量延迟、带宽和处理成本。二进制格式可能减小传输量,但协议收益不能只凭“内部调用”或“消息更小”的标签推断。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
Traffic patterns are an important factor in determining the appropriate format of API for the problem at hand. When we have full control over the services and exchanges within our microservices-based architecture, we can start to make compromises that we would not be able to make with external consumers. It is important to recognize that the performance characteristics of an east–west service are likely to be more applicable than a north–south service.
参考来源
- 位置:《Mastering API Architecture》第1章《Design, Build, and Specify APIs》之《Modeling Exchanges and Choosing an API Format》(源文件:_epub-src/OEBPS/ch01.xhtml)
- 结论依据:原文用南北与东西流量区分消费者控制权和性能环境,指出一个外部请求可能触发多次内部调用,并在 gRPC 部分要求性能选择必须测量。
- 原始内容:Traffic patterns are an important factor in determining the appropriate format of API for the problem at hand. When we have full control over the services and exchanges within our microservices-based architecture, we can start to make compromises that we would not be able to make with external consumers. It is important to recognize that the performance characteristics of an east–west service are likely to be more applicable than a north–south service.