basic concepts
RPC (Remote Proceduce Call) name: Remote Procedure Call, generally refers to C / S mode, the client through a function protocol for remote call server-side customizations, and can get to the function through the server returns the result, the client without concern for long-distance calls , and other details of the transmission network layer, can be achieved a calling function or the end friendly standard terminal B defined above.
advantage:
1, to reduce the transmission content, improving the transmission efficiency. RPC on TCP or HTTP2.0 general protocol, using a long connection for data communication, a plurality of times to reduce the HTTP protocol connection, disconnect the performance cost. And, transmitting the unified data structure may be specified in terms of C / S sides, without example: HTTP1.0 protocol such fixed protocol header, to reduce the amount of unnecessary data transmission, to improve system concurrency.
2, the distributed feature provides a powerful ability to reduce coupling system. For example, can be a huge system into multiple modules, modules for communication between multiple calls in the form of RPC, RPC allows the client module function call other ways almost the same as calling a local function, greatly increasing developer productivity .
3, high-resolution efficiency, support efficient binary transmission. There are many efficient than the traditional HTTP protocol many RPC transport protocol framework, for example: thrift, gRPC the Protobuf, compared to the conventional HTTP JSON \ XML format has a data transmission speed and the more efficient parsing a binary data transmission.
Disadvantages:
1, to achieve more complex. RPC generally need to go through to achieve a basic: the agreement is made -> protocol generator -> exchange protocol, compared to direct local Code, direct call function is more complex.
Common scenarios:
1, Distributed Computing
2, the database stored procedure calls
3, micro-services, distributed system architecture