In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what is the use of Web RPC". In daily operation, I believe many people have doubts about the use of Web RPC. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about "what is the use of Web RPC?" Next, please follow the editor to study!
What is RPC?
RPC is often mentioned by people, but it seems that no one has seriously explained and answered what RPC is. (take it as if you didn't see it, otherwise what else would I write?)
RPC is the abbreviation of Remote Procedure Call, that is, remote procedure call, can also be called remote program call.
It is a computer communication protocol that allows programs running on one computer to call subroutines of another computer.
What's the use of RPC?
In a computer, we can call and transfer data directly through code, or use multiple programs as a whole to achieve a function.
How do we use this invocation mechanism on multiple computers?
To extend the calling mechanism in one computer to multiple computers is to use multiple programs in multiple computers to implement a function (does it sound a bit like our distributed crawler)
In the above process, the calling party initiates the remote procedure call, then the environment of the calling party is suspended, the parameters are passed to the called party through the network, and the called party executes the program, and when the program execution is completed, the resulting result is returned to the calling party through the network, and the calling party resumes execution. Such a prototype idea is what we call RPC remote procedure call.
In the current computer applications, the performance of a single machine is difficult to meet the needs of products, and it is necessary to constantly expand multiple machines to improve the overall performance.
At the same time, in order to make full use of the computers in these clusters, we need to divide them from the architecture to provide different services, and the services call each other to complete the function of the whole product. RPC can help us solve the problem of information transfer and invocation between these services.
At the same time, our concept of RPC can also be understood in both broad and narrow sense.
Generalized concept of RPC
In a broad sense, all implementations that make communication calls through the network can be collectively referred to as RPC.
According to this understanding, we find that HTTP is actually a kind of RPC implementation.
The narrow concept of RPC
In a narrow sense, RPC is different from the implementation of HTTP, which is implemented independently in the data format and control of transmission.
For example, the data transmitted by communication between machines does not use the way of HTTP protocol (divided into starting line, header, body three parts), but uses the binary mode of custom format.
The RPC we talk about more often refers to this narrow sense of understanding.
Advantages and disadvantages of RPC
Compared with the traditional implementation of HTTP, the advantage of RPC is obvious. The party who initiates the RPC call can ignore the specific implementation of RPC when writing code, which is as efficient as writing local function calls.
The same shortcomings are also prominent. The versatility of RPC developed by ourselves is not as universal as HTTP, also because the transmitted data is not in HTTP protocol format. (the data transmitted by communication between machines does not use HTTP protocol.)
Call both sides of the need for special implementation of the communication library, for different programming development languages, must have related implementation. As a standard protocol, HTTP has been implemented in most languages and has better versatility.
Although each has its own advantages and disadvantages, the application fields of HTTP and RPC are not the same:
HTTP is more oriented to the communication between users and the product server.
RPC is more oriented to the communication between servers within the product.
At this point, the study of "what is the use of Web RPC" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.