gRPC learning process (a)

Copyright: Merry due share and eternity, knowledge sharing and immortal, I share my happiness ... https://blog.csdn.net/walter247443819/article/details/89356334

gRPC learning process (a)

"My husband, what is RPC Yeah, why do so many programmers cant!", My wife is, as always curious.
"RPC, Remote Procedure Call is short for it, translated into Chinese is the Remote Procedure Call Well," While I was looking at the book, while casual replied.
"What? You're talking about? I do not know who translated into Chinese What does this mean? You Got Nuthin, Go away to wash the dishes!"
"I went ..." I wake up, I sat across from is not a programmer, in order not to wash the dishes, I instantly mobilize all the brain cells, sea stars gathered in my brain, design ideas ...
"Well, remote procedure calls, of course with respect for the local procedure call Well. " "
ah ha, that give his aging mother talk about local procedure call is wisdom? " "
local procedure call, like you're at home, you want to wash the dishes, you direct the bowl in the dishwasher, open the dishwasher switches can be washed. this is called a local procedure call. " "
Ah, I can not do, and that is what the remote procedure call? " "
remote Well, now that you are not at home, with the sisters to wave , suddenly found not wash bowl, I called over and told me to wash the dishes, this is the remote procedure call it "easy to understand how to explain, I'm a genius!
"Oh! I see," said his wife began to pack bags.
"What are you doing to Oh,"
"I? I want to go off to the waves, when will I remember receiving remote calls oh, oh no, let's be professional point, it should be said, when will I remember receiving the RPC oh!"
...
Here Insert Picture Descriptionbased on consideration of factors such as high performance and high reliability, you decided to reform the system for distributed applications, many will be shared carry out separate functions, such as the above mentioned calculator, you put it in a separate service inside let other services to invoke it.

RPC two problems to be solved: solve the problem of distributed system calls, between services. When long-distance calls to local calls as easy as possible to let the caller can not perceive the logic of remote calls.

Here Insert Picture DescriptionA complete RPC procedure, can be described with the above image:

Client-side to the left, for example, Application is the caller's rpc, Client Stub is above us when it comes to the proxy object, that is, that looks like a Calculator implementation class, in fact, it is internal to the proxy remote call by way rpc objects, as Client Run-time Library, is a tool for remote call packet, such as the jdk the Socket, and finally realize the transmission of data is achieved through the underlying network.
This process is the most important thing is to serialization and de-serialization, because the data transmission packet must be binary, you just throw a Java object in the past, people do not know, you have to serialize Java objects into a binary format, pass an end to Server, Server receives after, then deserialized into Java objects.

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/walter247443819/article/details/89356334