知识卡片

普通读书笔记卡 · 3478

分层入口隐藏后端拓扑

理解等级:中级

分层系统约束让客户端通过统一入口访问 API,无需知道自己连的是最终服务、负载均衡器还是中间层。API 网关可以按请求把流量转给相应服务,把后端地址和部署拓扑藏在接口之后;这种隐藏减少客户端对内部结构的依赖。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Microservice APIs》第 4 章《Principles of REST API design》(源文件:_epub-src/OEBPS/Text/04.htm) - 结论依据:原文要求对客户端隐藏服务端层次,并以网关知道各服务地址、路由请求为具体方案。 - 原始内容:In a REST architecture, clients must have a unique point of entry to your API and must not be able to tell whether they are connected directly to the end server or to an intermediary layer such as a load balancer. ... The API gateway knows the server addresses of each service, and it knows how to map each request to the relevant service.