%% date:: [[2023-07-13]] parent:: %% # [[Remote Procedure Call]] Remote Procedure Call (RPC) is a type of [[API]] model that is procedure-oriented: it allows an application to call a function on a server over a network. ![](https://youtu.be/MdaGuP6-bKs) ^[despa] Unlike entity-oriented APIs like [[REST]], RPC makes a *function* or *procedure* addressable, not the underlying resources or data entities. ## Anatomy of an RPC API You need three things to call an RPC API: the name of the procedure you want to call, the parameter values that you want to pass, and the structure of the call itself. [^google] **The procedure** is the function on the remote server that you want to call. **The parameters** include values that you want to pass to the remote function. **The call** is the actual request, using a code-generated stub. ## Types of RPC APIs - [[OpenAPI]] can be thought of as an implementation of RPC that includes custom mappings of procedures to [[HTTP]]. [^google] - [[gRPC]] is an implementation of RPC that uses HTTP 2.0, and so is procedure-oriented but with an entity-oriented twist. - [[JSON-RPC]] - [[XML-RPC]] [despa]: Despa, V. [^google]: Nally, M. (2020). *gRPC vs REST: Understanding gRPC, OpenAPI and REST and when to use them in API design.* Retrieved on July 13th, 2023 from https://cloud.google.com/blog/products/api-management/understanding-grpc-openapi-and-rest-and-when-to-use-them