Lesson 2: Primer on Remote Procedure Call Flashcards
What is client-server architecture?
One or more nodes in a distributed system are clients. They send requests (for data or processing) to other designated server nodes. The server node receives the request, performs the requested action, and returns a response.
To return the requested data or processing result, the server copies the data from the server memory or storage into one or more network packets, and transmits them to the client.
Typically a client needs to provide some arguments when making a request. It must also copy this data from its memory into network packets and send them out.
Before this network exchange happens the client needs to identify the server its going to contact and if necessary, establish a connection with it.
What is RPC?
remote procedure call. its a way of doing distributed programming that looks like you’re just making a local procedure call.
What are the main mechanisms enabled by RPC?
- service registration
- connection management
- interface specification
- type system
- data management
- dealing with failures
What is hard in client-server systems?
- Discovery and binding. the client needs to find the server its going to contact
- identifying the interface and parameter types
- agreeing on the data representation
- explicit data management
- unpredictable delays
- unknown cause of failures
What are the goals of an RPC system?
- hide complexity of distributed programming from applications and developers
- make distributed programming appear similar to local node programming
What is the architecture of an RPC system?
Stub - When clients make a request they make a call to something that looks similar to a procedure, however, instead of having the program counter jump to the address space of the procedure the RPC call results in a jump into the stub layer. This layer has knowledge about the remote procedure, its arguments and results, it will perform all steps required for marshaling and unmarshaling
Describe synchronous vs asynchronous RPC
synchronous - the client makes a call, then must wait for a response
asynchronous - the client makes a call, then is free to do other things before eventually checking if response has arrived. if the client wants to be notified as soon as the response is available, this is called registering a callback
What kinds of guarantees do RPCs make regarding the delivery of RPC calls?
at most once - rpc system eliminates duplicates
at least once - no guarantees duplicates will be eliminated
What is the architecture of an RPC system?
API - the programming interface that clients and servers use to interact with the system
Stub - when client makes a request, they make a call to something that looks similar to a procedure but instead of having the program counter jump to a location in the address space that holds the implementation of the procedure, the RPC call results in a jump into the stub layer. this layer has knowledge about the remote procedure, its arguments and results, and will provide all steps required for marshaling and unmarshaling data.
RPC Runtime - responsible for tasks like connection management, sending and receiving data, dealing with failures, etc.
Interface Definition Language (IDL) - used to create an interface specification
RPC Compiler - takes the IDL and generates code that’s used by the stubs and the runtime.
Service Registry - rules for how servers announce their services and become discoverable