Do you know about RPC ?
Background:
For communication between front-end client and back-end server we have different ways :
- REST APIs
- GraphQL
- 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:
- XML-RPC
- JSON-RPC
Slack has provided its RPC based Web API :
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)