Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comparison between HTTP and RPC

RPC protocol uses TCP as an underlying protocol and HTTP again uses TCP as an underlying protocol. So why is HTTP is widely accepted?

Why does SOAP use HTTP as an underlying protocol - why not RPC?

like image 378
Programmer Avatar asked Aug 21 '13 07:08

Programmer


People also ask

What's the difference between RPC and HTTP?

RPC is action-oriented. In contrast, REST is resource-oriented. REST utilizes HTTP methods GET, POST, PUT, PATCH, and DELETE to perform CRUD operations. However, RPC only supports GET and POST requests.

Is HTTP a type of RPC?

Both RPC and REST use HTTP protocol which is a request/response protocol.

What's the difference between REST and RPC?

The most fundamental difference between RPC and REST is that RPC was designed for actions, while REST is resource-centric. RPC executes procedures and commands with ease. Alternatively, REST is ideal for domain modeling and handling large quantities of data. Next, let's look at communication protocols.

What is the difference between RPC and API?

An API is built by defining public methods; then, the methods are called with arguments. 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.


2 Answers

Remote Procedure Calls (RPC) is not a protocol, it's a principle that is also used in SOAP.

SOAP is an application protocol that uses HTTP for transport (so it won't have to think about encoding, message boundaries and so on). One of the reasons to use SOAP over HTTP is that for HTTP you usually don't need firewall rules and that the HTTP infrastructure is mature and commonly rolled out.

like image 146
CodeCaster Avatar answered Oct 01 '22 14:10

CodeCaster


RPC does not require HTTP. Basically, RPC describes any mechanism that is suitable to invoke some piece of code remotely. The transport mechanism used to perform the RPC could be SOAP over HTTP. It could also be a REST call returning some JSON data over HTTP.

SOAP can also be used via Mails, and AFAIK (not sure here) the BizTalk Server should support this scenario. But even something exotical like trying SOAP over Avian Carriers can also be considered an RPC, although the latency of the latter may not be sufficient for real-world applications.

Think of an RPC as sending somehow some kind of message to a destination, in order to initiate a specific action and (optionally) getting some information back after the action has been completed. What prticular technology you choose to transmit these messages does not really matter.

like image 20
JensG Avatar answered Oct 01 '22 14:10

JensG