RPC Introduction
What is RPC
Remote Procedure Call (RPC) 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. A procedure call is also sometimes known as a function call or a subroutine call.
RPC 是一种远程过程调用协议,一个程序可以使用该协议从位于网络上另一台计算机中的程序请求服务,而无需了解网络的详细信息。RPC 有时也称为函数调用或子程序调用。RPC 是进程间通信的一种方式。
Why is RPC
网上很多关于 RPC 的优点,笔者都不太赞同。不能将那些成熟的 RPC 框架解决的问题全部归结为 RPC 的优点。比如 RPC 的概念中并没有提到服务治理等问题,但是常见的 RPC 框架(如 DUBBO)均解决了服务治理的相关问题,这显然不能作为 RPC 的优点。要解释“Why is RPC?”的问题,还是要回归到 RPC 的概念上来。
RPC可以使远程过程调用变得像本地调用一样简单。- 方便计算能力的横向扩展。
有兴趣可以阅读 dubbo 诞生的背景 以及dubbo 解决了哪些需求。
RPC vs HTTP
其实这两者不是同一个维度的概念。从 RPC 的概念上来讲,HTTP 其实就是 RPC 的一种实现。