What is RPC?

Samarth Asthan
1 min readNov 30, 2023

--

RPC, or Remote Procedure Call, is like a phone call between computer programs. it’s a way they talk to each other in distributed systems when a program wants another program to do something in a different space, like on another computer.

Here’s how it works:

1. Initiating the Call: Imagine you are the client making a call. You give your friend (the client stub) the details, and it prepares a message.

2. Message Packaging: Your friend formats the message nicely with all details and asks the delivery person (RPC runtime) to take it to your friend on another computer (Server)

3. Sending the Message: The delivery person takes the message to the other computer over the network and waits for a reply.

4. On the Other Side: The friend on the other computer (Server) gets the message, opens it up, and understands what needs to be done, This friend (Server stub) then asks another delivery person (Server’s RPC runtime) to send the result back.

5. Receiving the Result: The result travels to you through the network, and your friend (Client’s RPC runtime) hands it over.

6. Unpacking and Done: Your friend (Client stub) unpacks the result, and you can continue your work as if you made a regular call.

--

--

Samarth Asthan

Talks about GoLang and System Design 🫣👨🏻‍💻