In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Why do calls between services use RPC? I believe many inexperienced people are at a loss about this. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
RPC (Remote Procedure Call)-remote procedure call, which is a protocol that requests services from remote computer programs over the network without knowing the underlying network technology. For example, if two different services An and B are deployed on two different machines, what if Service A wants to invoke a method in Service B? Using HTTP requests is fine, but it may be slow and some optimizations are not well done. The emergence of RPC is to solve this problem.
What is the RPC?RPC principle? What is RPC?
RPC (Remote Procedure Call)-remote procedure call, which is a protocol that requests services from remote computer programs over the network without knowing the underlying network technology. For example, if two different services An and B are deployed on two different machines, what if Service A wants to invoke a method in Service B? Using HTTP requests is fine, but it may be slow and some optimizations are not well done. The emergence of RPC is to solve this problem.
What is the principle of RPC?
Here is a brief mention. For more information, please see the following article:
The service consumer (client) call invokes the service in a local invocation
After receiving the call, client stub is responsible for assembling methods, parameters, etc., into a message body that can be transmitted over the network.
Client stub finds the service address and sends the message to the server
Server stub decodes the message after receiving it.
Server stub calls the local service based on the decoding result
The local service executes and returns the result to server stub
Server stub packages the returned result into a message and sends it to the consumer
Client stub receives the message and decodes it
The service consumer gets the final result.
Here is another time sequence chart posted online:
What problem did RPC solve?
From the content introduced by RPC above, generally speaking, RPC mainly solves the problem of making calls between different services in distributed or micro-service systems as simple as local calls.
Summary of common RPC frameworks?
RMI (included with JDK): RPC, which comes with JDK, has many limitations and is not recommended.
Dubbo: Dubbo is a high-performance and excellent service framework opened by Alibaba Company, which enables applications to realize the output and input functions of services through high-performance RPC, and can be seamlessly integrated with the Spring framework. At present, Dubbo has become the official component of Spring Cloud Alibaba.
GRPC: gRPC is a modern open source high-performance RPC framework that can run in any environment. It can effectively connect services within and across data centers through pluggable support for load balancing, tracking, health checking, and authentication. It also applies to the last mile of distributed computing to connect devices, mobile applications and browsers to back-end services.
After reading the above, do you understand why calls between services use the RPC method? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.