RPC和HTTP的区别

先看一下概念

RPC(Remote Procedure Call)

wiki

In distributed computing, a remote procedure call (RPC) is when a computer program causes a procedure (subroutine) to execute in a different address space (commonly on another computer on a shared network), which is coded as if it were a normal (local) procedure call, without the programmer explicitly coding the details for the remote interaction. That is, the programmer writes essentially the same code whether the subroutine is local to the executing program, or remote. This is a form of client–server interaction (caller is client, executor is server), typically implemented via a request–response message-passing system. In the object-oriented programming paradigm, RPCs are represented by remote method invocation (RMI). The RPC model implies a level of location transparency, namely that calling procedures are largely the same whether they are local or remote, but usually they are not identical, so local calls can be distinguished from remote calls. Remote calls are usually orders of magnitude slower and less reliable than local calls, so distinguishing them is important.

翻译:在分布式计算中,远程过程调用(RPC)是指计算机程序使一个程序在不同的地址空间(通常在共享网络上的另一台计算机上)中执行,该地址空间的编码就好像它是一个普通的(本地)过程调用一样,而程序员没有显式地对远程交互的细节进行编码。也就是说,无论程序是执行本地程序,还是远程程序,程序员编写的代码基本相同。这是一种客户机-服务器交互的形式(调用者是客户机,执行者是服务器),通常通过请求-响应消息传递系统实现。在面向对象编程范式中,rpc由远程方法调用(RMI)表示。RPC模型意味着位置透明性的级别,即调用过程在很大程度上是相同的,无论它们是本地的还是远程的,但是通常它们是不相同的,因此本地调用可以与远程调用区分开来。远程调用通常比本地调用慢几个数量级,可靠性也低,因此区分它们很重要。

所以RPC是相对本地调用的,重点是节点(机器)间调用,是相区分于机器内部调用。其可以通过不同的网络协议来实现。

HTTP

http(超文本传输协议) 是互联网上应用最为广泛的一种网络协议,是建立在TCP协议之上的一种应用层协议。主要应用在浏览器、web服务器交互。跨系统的接口调用等。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值