In distributed computing, a remote procedure call (RPC) is an action in which a computer program causes a procedure (subroutine) to execute in a different address space of the current process (commonly on another computer on a shared computer network), which is written as if it were a normal (local) procedure call, without the programmer explicitly writing the details for the remote interaction. That is, the programmer writes essentially the same code whether the subroutine is local to the executing program, or remote. This is a form of server interaction (caller is client, executor is server), typically implemented via a request–response message passing system. In the object-oriented programming paradigm, RPCs are represented by remote method invocation (RMI). The RPC model implies a level of location transparency, namely that calling procedures are largely the same whether they are local or remote, but usually, they are not identical, so local calls can be distinguished from remote calls. Remote calls are usually orders of magnitude slower and less reliable than local calls, so distinguishing them is important.
RPCs are a form of inter-process communication (IPC), in that different processes have different address spaces: if on the same host machine, they have distinct virtual address spaces, even though the physical address space is the same; while if they are on different hosts, the physical address space is also different. Many different (often incompatible) technologies have been used to implement the concept. Modern RPC frameworks, such as gRPC and Apache Thrift, enhance the basic RPC model by using efficient binary serialization (e.g., Protocol Buffers), HTTP/2 multiplexing, and built-in support for features such as authentication, load balancing, streaming, and error handling, making them well-suited for building scalable microservices and enabling language interoperability.
Remote procedure calls used in modern operating systems trace their roots back to the RC 4000 multiprogramming system, which used a request-response communication protocol for process synchronization. The idea of treating network operations as remote procedure calls goes back at least to the 1970s in early ARPANET documents. In 1978, Per Brinch Hansen proposed Distributed Processes, a language for distributed computing based on "external requests" consisting of procedure calls between processes.
One of the earliest practical implementations was in 1982 by Brian Randell and colleagues for their Newcastle Connection between UNIX machines. This was soon followed by "Lupine" by Andrew Birrell and Bruce Nelson in the Cedar environment at Xerox PARC. Lupine automatically generated stubs, providing type-safe bindings, and used an efficient protocol for communication.
- RPyC implements RPC mechanisms in Python, with support for asynchronous calls.
- Distributed Ruby (DRb) allows Ruby programs to communicate with each other on the same machine or over a network. DRb uses remote method invocation (RMI) to pass commands and data between processes.
- Erlang is process-oriented and natively supports distribution and RPCs via message passing between nodes and local processes alike.
- Elixir builds on top of the Erlang. It allows process communication (Elixir/Erlang processes, not OS processes) of the same network out of the box via Agents and message passing.
- Google's Rust RPC framework Tarpc lets developers define the structure of messages using Rust's structs and traits, rather than using protobuf.
Application-specific
- Action Message Format (AMF) allows Adobe Flex applications to communicate with back-ends or other applications that support AMF.
- Remote Function Call is the standard SAP interface for communication between SAP systems. RFC calls a function to be executed in a remote system.
General
- NFS (Network File System) is one of the most prominent users of RPC
- Open Network Computing RPC, by Sun Microsystems (also known as Sun RPC)
- D-Bus open source IPC program provides similar function to CORBA.
- SORCER provides the API and exertion-oriented language (EOL) for a federated method invocation
- XML-RPC is an RPC protocol that uses XML to encode its calls and HTTP as a transport mechanism.
- JSON-RPC is an RPC protocol that uses JSON-encoded messages.
- JSON-WSP is an RPC protocol that is inspired from JSON-RPC.
- SOAP is a successor of XML-RPC and also uses XML to encode its HTTP-based calls.
- ZeroC's Internet Communications Engine (Ice) distributed computing platform.
- Etch framework for building network services.
- Apache Thrift protocol and framework.
- CORBA provides remote procedure invocation through an intermediate layer called the object request broker.
- Libevent provides a framework for creating RPC servers and clients.
- Windows Communication Foundation is an application programming interface in the .NET framework for building connected, service-oriented applications.
- Microsoft .NET Remoting offers RPC facilities for distributed systems implemented on the Windows platform. It has been superseded by WCF.
- The Microsoft DCOM uses MSRPC which is based on DCE/RPC
- The Open Software Foundation DCE/RPC Distributed Computing Environment (also implemented by Microsoft).
- Google Protocol Buffers (protobufs) package includes an interface definition language used for its RPC protocols open sourced in 2015 as gRPC.
- WAMP combines RPC and Publish-Subscribe into a single, transport-agnostic protocol.
- Google Web Toolkit uses an asynchronous RPC to communicate to the server service.
- Apache Avro provides RPC where client and server exchange schemas in the connection handshake and code generation is not required.
See also
- 9P
- Microsoft RPC
- Local Inter-Process Communication
- HTTP
- ODBC
- Remote evaluation
- External Data Representation (serialization format used by e.g. NFS)
- Network Data Representation (serialization format used by e.g. Microsoft RPC)
- Resource-oriented architecture
- Distributed object middleware
- Fragmented object
- gRPC
References
External links
- – Towards Remote Procedure Call Encryption by Default
- - Specifies version 2 of ONC RPC (third published RFC version 2)
- - Specifies version 2 of ONC RPC (second published RFC version 2)
- - Specifies version 2 of ONC RPC (first published RFC version 2)
- - Specifies first version of ONC RPC (first published RFC version)
- Remote Procedure Calls (RPC) — A tutorial on ONC RPC by Dr Dave Marshall of Cardiff University
- Introduction to RPC Programming — A developer's introduction to RPC and XDR, from SGI IRIX documentation.
