In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
What is the working principle of gRPC? aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
GRPC has become an important technology to implement distributed software systems that need large-scale and fast operation. In short, gRPC is an API framework that allows one program to pass data from one location on the Internet to unique functions in another program for processing.
Other API frameworks, such as REST, typically use text-based formats such as JSON or XML to pass data between the client and the server, while under gRPC, the data is passed between the client and server-side target functions in binary format.
The binary nature of the payload is one of the sources of its reputation for being faster than other methods. Programs that use gRPC can be executed in nanoseconds instead of the milliseconds typically used when using text-based data.
Data sharing is the starting point. Companies need to transfer data from one computer to another in order to process information in a way that is unique to each system.
The basic idea behind RPC is that processes (also known as functions) running on one machine can be shared by other machines in different locations on the network. The advantage of RPC is that it reduces system redundancy. When the upgrade process is required, all changes occur in a single location
1 Why gRPCHTML is text-based like XML. These are huge formats because they require the opening and ending tags JSON, another popular text-based data format, which is even more concise than XML, where all data is transmitted in binary format. The information is serialized into a compact set of bits and then sent over the network. Then, when the data reaches the target destination, it is deserialized into text. The binary format used in gRPC is protocol buffering. Using protocol buffering allows data to be transferred quickly, but it also brings costs due to the overhead of describing the data. Trade space for time.
The basic concepts behind gRPC. Note that the client and server communicate through HTTP/2, and the information can be exchanged as a single request / response event or as a continuous stream.
two
In gRPC mode, the .proto file contains the function signature issued by the server. According to the published function declaration, the client will use this information to pass the message to a specific function. An example of a defined function declaration is as follows in the .proto file. The format is as follows:
Rpc Add (Request) returns (Response) {}
Rpc is a reserved protocol buffer keyword, indicating that the function is a remote procedure call Add is the name of the function (Request) indicates that the function has a parameter of a custom message type Requestreturns is a reserved protocol buffer keyword, the prefix (Response) of the return type of the function indicates that the function will return a custom message type, and this is the answer to Response's question about how gRPC works. I hope the above content can help you to a certain extent, if you still have a lot of doubts to be solved, you can follow the industry information channel to learn more related knowledge.
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.