Skip to content
BENIBIX Learn

Remote Procedure Call (RPC)

Development🔌 APIsAPI Architecture Styles

Also known as RPC, Remote Call

You call a function in your code, but it runs on a far machine.

Think of it like

Think of it like calling a friend and asking them to do a sum for you. It feels like doing it yourself.

Example

Emma's checkout calls chargeCard on the payment service. It looks like a normal call, but it goes over the network.

Why it matters

Many systems split into services that talk by RPC. It is the main idea behind gRPC.

Definition

A remote procedure call runs a function on another computer, as if it were local. You call something like getUser(42), and the network trip happens out of sight. The other computer runs the function and sends the result back. Where REST is built around things, RPC is built around actions. gRPC and JSON-RPC are well-known kinds.

Common mistake

Forgetting that the call crosses a network. It can be slow, time out or fail halfway, unlike a local call.

Key takeaways

  1. 1
    Looks like a function. getUser(42).
  2. 2
    Runs somewhere else. Across the network.
  3. 3
    Built on actions. Not on things, like REST.