Remote Procedure Calls (RPCs)

Introduction

API servers require enormous computing power to serve a large number of clients. Companies like Amazon, Slack, Google, Twitter, Netflix, eBay, and others rely heavily on distributed systems to achieve high performance and scalability. In a distributed system, functionalities are divided into different subcomponents, distributing responsibilities to a set of independently working machines, called microservices. Initially, people started building their own protocols and methods to communicate processes over the wire, which led to various customized protocols. In the late 1970s, the Remote Procedure Call (RPC) architecture was introducedBirrell, Andrew D., and Bruce Jay Nelson. 1984. “Implementing Remote Procedure Calls.” ACM Transactions on Computer Systems 2 (1): 39–59. https://doi.org/10.1145/2080.357392. ‌ to manage and standardize the communication between two remote entities via a simple abstraction. Later on, RPC became a popular mechanism to communicate between microservices and get some useful work done. RPC is not a new concept, it’s a communication abstraction that enables remote code execution without worrying about the complexities of the underlying network. Let's see what a modern RPC style looks like.

What is an RPC?

A remote procedure call (RPC) architecture is a service or action-oriented style of creating APIs, where resources are distributed among different services running on remote machines. RPC facilitates interprocess communication by enabling clients to run remote procedures (functions) in a simple local function-call-likeFor example, a simple programming function that is called to return a value after performing some operations that are hidden from the callee. abstraction. A generic RPC architecture is shown in the illustration below:

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.