RPC Mind map, make RPC no longer difficult to understand
Analytical
RPC (remote Procedure call), which is a protocol that requests services over a network from a remote computer program without needing to know the underlying network technology.
In the OSI network communication model, RPC spans the transport and application tiers.
RPC makes it easier to develop applications that include distributed, multi-program networks.
Why to use RPC
Can be distributed, modern micro-services
Flexible deployment
Decoupling services
Strong extensibility
The purpose of RPC is to let you call the remote method locally, and for you the call is transparent, and you do not know where the call is deployed. The real purpose of using RPC is to decouple the service through RPC.
Working principle
RPC takes client/server mode. The requestor is a client, and the service provider is a server. First, the client call process sends a call message with process parameters to the service process, and then waits for the reply message. On the server side, the process stays asleep until the call information arrives. When a call arrives, the server obtains the process parameters, evaluates the result, sends a reply message, and then waits for the next invocation information, and finally, the client invokes the process to receive the reply message, obtains the process result, and then invokes execution to proceed.
Issues that the RPC framework solves for US
Communication problem, i.e. communication between A and B, establishing a TCP connection
Addressing issues, a server connected to B through the RPC framework and a specific port and method name of the call
parameter serialization and deserialization, initiating a remote call parameter value requires binary, the service receives the binary parameter and needs to deserialize
Compared to HTTP services
Common RPC Framework
Dubbo
Dubbo is a distributed service framework dedicated to providing high-performance and transparent RPC remote service invocation scenarios, and is the core framework of Alibaba SOA Service governance solution, providing 3,000,000,000+ per day support for 2,000+ services. And is widely used in Alibaba Group members of the site.
Motan
Motan is a Java framework for Sina Weibo's open source. It was born relatively late, starting in 2013, May 2016 open source. Motan has been widely used in micro-blogging platforms, with nearly blade calls for hundreds of services per day.
Grpc
GRPC is a high-performance, common, open-source RPC framework developed by Google, developed by Google primarily for mobile applications and based on the HTTP/2 protocol standards, developed based on the PROTOBUF (Protocol buffers) serialization protocol, and supports many development languages. itself it is not distributed, so to achieve the functionality of the above framework requires further development.