RPC Flashcards
What is RPC?
Remote procedure call
A networking pattern used in client-server architectures.
How does RPC work?
A server offers a set of operations, and a client can call these operations. at the clientside the operation is called as though it was local because of the middleware attached at both ends.
How does RPC allow the client to call the server as though it was local?
With the help of middleware which makes use of the service interface.
The server and the client communicates with middleware which gives the illusion that the other part is local. The middleware then does the communication over internet.
What is some features with RPC?
It allows one process on one machine, to start an operation on another machine (requires network)
it simplifies building of the client-side as you dont have to translate code in the client, the middleware will do that
it has an IDL (interface definition language) which is the ‘list/interface’ of procedures that can be called. (like a registry of the methods i think he said once).
Is RPC async or sync?
at its core simple RPC in its simplest form is a synchronous process. If you start a thread to make a request that thread waits for the response.
How does a RPC flow look when a client calls a server?
client sends arguments to methods in the middleware the middleware sends it through the internet with rpc protocol to the client.
client sends arguments to the middleware, call it a stub or ORB (object request broker) if you want, these arguments goes into methods which have been created from the IDL which is the description of methods and how to call them on the server. It then uses the RPC protocol to contact the server which goes up the same layers.
what are some typical errors that can happen?
client cant reach server
loss of request/response due to network.
server crash
client crash
How can you handle a client cant reach server error?
Try to resend the request if its idempotent
- for non idempotent request add a sequence variable to let server know the request is a retransmit
How can you deal with servercrash?
Keep trying, dont guarentee anything so if the server crashes the client doesnt know how to not deal with no response.
hard because the client wont know why there is no response
How can you deal with client crashes?
Expiration: each RPC is given an amount of time to dojob
What is XML-RPC?
It is an RPC protocol which passes information from client to the server in XML format… its just RPC using XML format.
Parameters are a simple list of types and content; structs and arrays are the most complex types available; no object type
What does the XML format look like?
Extensible Markup Language (XML) file. These are really just plain text files that use custom tags to describe the structure and other features of the document