当前位置:网站首页>What is RPC

What is RPC

2022-04-23 08:23:00 weixin_ forty-six million two hundred and seventy-two thousand

What is? RPC

The following excerpt from Baidu Encyclopedia

Remote procedure call protocol

RPC(Remote Procedure Call)— Remote procedure call , It is a way of requesting services over a network from a remote computer program , You don't need to know > Protocol of layer network technology .RPC Protocols assume the existence of certain transport protocols , Such as TCP or UDP, Carry information data between communication programs . stay OSI The Internet > In the communication model ,RPC Across the transport and application layers .RPC Makes it easier to develop applications that include networked distributed multiprogramming .

RPC Using the client / Server mode . A requester is a client , A service provider is a server . First , The client calls the process > Send a call information with process parameters to the service process , Then wait for the answer . On the server side , The process remains asleep until the call message arrives at > stop . When a call message arrives , Server gets process parameters , The result of the calculation is , Send reply , Then wait for the next call message , Last , Customer > The end call process receives the reply information , Get process results , Then call execution to proceed. .

There are many kinds of RPC Mode and execution . By the first Sun The company proposed .IETF ONC The Charter has been revised Sun edition , bring ONC RPC Agreement become >IETF Standard agreement . The most commonly used model and implementation is the distributed computing environment based on open software (DCE).

Terminology can be complex , How do we understand RPC Well ?

In my eyes RPC

Service providers provide ---- Consumer consumption

The service provider fished seafood in Qingdao , Consumers sat in a restaurant in Xinjiang and ordered a plate of spicy crayfish
The middle process is RPC

Existence is reason , The reason why complex things can continue to exist and develop is not without reason , It's not because the experts are mystifying , Mainly because it can bring some obvious benefits , The more proficient you are in these things , The more you like it . About RPC, A long time ago RPC There are several others, such as DCOM,CORBA,RMI(Java)AXIS etc. , There are many tricks now , The basic principle is to use XML perhaps JSON To pass the call parameters and results . The main advantages of personal experience are as follows :

RPC Be able to cross a variety of development tools and platforms , For example, the existing system of the enterprise has been developed or the subsystem has been deployed and delivered , It provides RPC Interface , New subsystems need to be integrated , Use industry common RPC The interface can be integrated , You can't ask the original developer to modify the interface again , Otherwise, it will become an information island ;

RPC Ability to span multiple servers , This can be easily accessed on other computers 80 Port of RPC To access various servers . Other such as TCP Message to access , It's efficient but inconvenient, and it has to penetrate the firewall , Especially inconvenient for web page integration .

Take a chestnut

Remote call simply means sending a request to the remote machine , The process of the remote machine returning a result , Why do you do this , The performance of a single Internet server is far from meeting the needs of today's users , It's like you go to KFC and order a meal , The waiter at the table assigned the task of French fries and chicken burgers to different people , Then collect it for your process , The table attendant is equivalent to calling the remote service .

But if not , The order clerk does these things directly ( I have to order again , French fries again , Fried chicken legs and so on ), Two phase comparison , You'll know the benefits of remote calls

Simply put, you can't in one process , Even a computer through local calls to complete the requirements , For example, communication between different systems , Even communication between different organizations . Because computing power needs to scale out , You need to deploy applications on a cluster of multiple machines .

RPC Advantages and disadvantages

RPC The advantages of :

  • Improve system scalability
  • Improve system maintainability and continuous delivery capability
  • Realize high availability of the system

RPC The shortcomings of :

  • A perfect RPC The framework development is very difficult , Need more staffing
  • RPC The success rate of framework calls is limited by network conditions
  • It is difficult for beginners to call remote methods

版权声明
本文为[weixin_ forty-six million two hundred and seventy-two thousand ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230748008989.html