目录
RPC是什么
RPC(Remote Procedure Call)
-
is a protocol
-
that one program can use to request a service from a program located in another computer on a network
-
without having to understand the network's details
-
A procedure call is also sometimes known as a function call or a subroutine call
-
RPC uses the client-server model
RPC的优点
-
本地调用 - 似本地调用的方式获取远程服务
-
网络传输透明 - 灵活(不必关心通信实现: HTTP、TCP、Websocket)且高效(TCP优于HTTP)
-
扩展性强 - RPC使得开发包括网络分布式多程序在内的应用程序更加容易
RCP框架通常会实现数据序列化和反序列化
RPC的缺点
-
学习和调试成本更高
-
耦合性高 - 调用者需要知道所调用接口的函数名、参数格式、参数顺序、参数名称等
-
微服务提高了系统复杂度 部署和维护难度也更高 - 灰度发布、服务注册与治理
网友评论