RPC
RPC (Remote Procedure Call) is a programming paradigm that allows a client program to call a procedure (or function) on a remote server as if it were a local procedure. This simplifies distributed computing by abstracting away the underlying network communication.
RPC vs RESTful API
Compared to RESTful APIs, RPCs offer better documentation and efficiency due to their typed nature.
Besides Unary RPCs where the client sends a single request to the server and gets a single response back. Unidirectional streaming and bidirectional streaming are also supported, which are not included in typical RESTful APIs.
RPC implementations are more complex than RESTful APIs. However, this can be mitigated by toolchains. Typically, you define the API in a format like Protocol Buffers, and tools generate client and server code automatically.
While RPC introduces complexity to set up initially compared to RESTful APIs, and might also require a steeper learning curve, but for larger-scale projects, it worth the trouble.