DEV Community

varunprashar5
varunprashar5

Posted on

What the heck is RPC ?

Do you know about RPC ?

Background:

For communication between front-end client and back-end server we have different ways :

  1. REST APIs
  2. GraphQL
  3. RPC

These days GraphQL is being quite used due to lower network hits & less communication between mobile team, front-end and back-end developer. Still we don’t make the whole app using graphQL but try to follow hybrid approach of using REST APIs + GraphQL as per use-cases.

What is it ?

RPC (Remote Procedure call) is same as calling a function in Javascript, Python etc taking a method name and arguments. It is like executing a block of code on another server.
RPC is just a bunch of functions, but in the context of an HTTP API, that entails putting the method in the URL and the arguments in the query string or body.

There are few specifications for it like:

  1. XML-RPC
  2. JSON-RPC

Slack has provided its RPC based Web API :

https://api.slack.com/web

Its is most often used in “Microservices” based architecture where these microservcies communicates with each other via RPC calls.

Do you think if there are any performance gains if we are using it ?
Is there any limitation or challenges of using it ?
Do share in comments

Top comments (0)