Network Abstractions: Remote Procedure Calls
We'll cover the following...
RPCs abstract network communication, letting developers call functions on a remote server as if they were local method calls. This abstraction hides details such as argument serialization, network transmission, and retry logic.
What is an RPC?
Remote Procedure Call (RPC) is a widely used interprocess communication protocol in distributed systems. In the OSI model, it spans the transport and application layers. RPCs enable a program to execute a subroutine in a separate address space, typically on a different machine.
Note: Programmers write the code as a standard local procedure call, ignoring the underlying details of remote interaction.
How does RPC work?
When a client makes a synchronous RPC call, the calling thread blocks until a response is received. The procedure arguments are serialized and transmitted to the remote server over the network. After the server completes execution, the response is sent back to the client, and the blocked thread resumes as if it had returned from a local function call. Consider a client-server setup with five main components: