Skip to main content
Definition Website Computer and Technology

Remote Procedure Call

Subject: Computer and Technology noun /rɪˈmoʊt prəˈsiː.dʒər kɔːl/ 1 definition

  1. Definition (noun)

    Entry #100 · Updated

    A Remote Procedure Call (RPC) is an interprocess communication mechanism that allows a client program to invoke a subroutine in a separate address space—typically on another host across a network—while hiding transport details behind the appearance of a local function call. During execution, a client stub serializes (marshals) the procedure identifier and arguments into a network message and transmits them to a server stub, which deserializes the payload, runs the target routine, and sends back the return value or error. By abstracting away socket handling, byte ordering, and data encoding through defined interfaces, RPC streamlines distributed systems programming, though callers must still account for network latency, partial failures, and timeouts absent from local calls.

    Common Forms

    • Synchronous Request-Response RPC: Blocks the calling thread until the remote server finishes executing the procedure and returns a response or timeout error, preserving familiar sequential control flow at the cost of holding client resources during network waits.

    • Asynchronous and Streaming RPC: Issues invocations without blocking the caller—using futures, callbacks, or multiplexed message streams—to support high-concurrency workloads and continuous bidirectional data exchange over a single connection.

    • Binary Schema-Driven RPC: Relies on an Interface Definition Language (IDL) such as Protocol Buffers or Apache Thrift to generate strongly typed client and server stubs and serialize payloads into compact binary messages (exemplified by gRPC over HTTP/2).

    • Text-Based Web RPC: Encodes procedure names, parameters, and results in human-readable formats like JSON or XML over HTTP or WebSockets—as in JSON-RPC and XML-RPC—prioritizing broad interoperability and straightforward debugging over wire compactness.

    Example

    In a microservices e-commerce platform, the checkout service invokes a generated gRPC stub method CalculateTax(orderItems, shippingAddress) as though it were a local function, automatically serializing the arguments into a Protocol Buffers payload sent over HTTP/2 to a remote tax service. The tax service deserializes the request, computes the regional sales tax, and returns a typed response object so the checkout service receives the calculated amount without manually constructing HTTP requests or parsing JSON.