RPC (Remote Procedure Call)

Summary: A model that tries to make a request to a remote network service look like a local function call.

Sources: chapter4

Last updated: 2026-04-15


The Remote Procedure Call (RPC) model has been around since the 1970s. It tries to achieve location transparency, but this is fundamentally flawed because network requests are very different from local function calls.

Problems with RPC

  1. Unpredictable: A network request may fail or be lost due to issues outside your control.
  2. Timeouts: A network request can return without a result (timeout), leaving the caller in the dark.
  3. Idempotence: Retrying a failed request can cause the action to be performed multiple times.
  4. Variable Latency: Network requests are much slower and have wildly variable latency.
  5. Data Encoding: Pointers cannot be passed; all parameters must be encoded as byte sequences.

Modern RPC Frameworks

Despite these flaws, RPC isn’t going away. Modern frameworks address some of these issues:

  • gRPC: Uses protocol-buffers and supports streams.
  • Finagle: Uses futures (promises) to encapsulate asynchronous actions.