« Back to Index

RPC: Remote Procedure Call

View original Gist on GitHub

RPC: Remote Procedure Call.md

RPC is a way of connecting two separate services via a raw TCP socket

Note: SOAP, Thrift, REST APIs, message queues such as RabbitMQ, and key value stores such as Etcd are examples of other tools and protocols

Basic outline

The fundamental principle is, you define an RPC service:

From here we have a client service that calls the RPC service:

JSON-RPC

The client JSON could look like:

{"method": "Arith.Multiply", "params": [{"A": 2, "B": 3}], "id": 1}

The RPC server JSON response could look like:

{"result": 6, "error": null, "id": 1}