Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between REST, SOAP and RPC

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the difference between REST, SOAP and RPC, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.

What is RPC?

RPC (Remote Procedure Call Protocol)-Remote Procedure Call Protocol is a protocol for requesting services from remote computer programs over a network without knowledge of the underlying network technology.

In short, RPC enables programs to access remote system resources as well as local system resources.

Some of the more critical aspects include:

communication protocol

serialization

Resource (interface) description

services framework

performance

Language support, etc.

REST and SOAP, RPC

1.REST

it can be seen as a direct application of http protocol. json is used as the transmission format by default. it is simple to use, low in learning cost and high in efficiency, but low in security.

2.SOAP

SOAP is a data exchange protocol specification, a lightweight, simple, XML-based protocol specification. SOAP is a heavyweight protocol. Based on XML,SOAP realizes security control by using WS-Security composed of XML-Security and XML-Signature. At present, SOAP has been supported by various manufacturers.

What are its advantages? To sum it up: easy to use, flexible, cross-language, cross-platform.

What is RPC (Remote Procedure Call)?

RPC is simply a function or method (collectively referred to as a service) that is called from one machine (client) to another machine (server) via parameter passing and returns the result.

What is the difference between REST and SOAP? There is not much difference, their essence is to provide basic services that can support distribution, the biggest difference lies in their respective characteristics brought about by different application scenarios.

RPC works

At runtime, a client RPC call to the server, its internal operation roughly has the following ten steps:

1. Call client handle; execute transfer parameters

2. Call the local system kernel to send network messages

3. Message delivery to remote host

4. The server handle gets the message and gets the parameters

5. Execute remote procedures

6. The procedure executed returns the result to the server handle

7. Server handle returns result, calling remote system kernel

8. Message returned to local host

9. Client handles receive messages by kernel

10. The client receives the data returned by the handle

Mainstream RPC framework

A brief introduction to some of the more typical ones:

1.RMI

The java.rmi package implementation is based on Java Remote Method Protocol and java's native serialization.

2.Hessian

RMI is a lightweight remoting onhttp tool that provides RMI functionality in a simple way. Based on HTTP protocol, binary codec is adopted.

3.protobuf-rpc-pro

A Java library that provides a framework for remote method calls based on Google's Protocol Buffers protocol. Based on Netty's underlying NIO technology. TCP reuse/ keep-alive, SSL encryption, RPC call cancellation, embedded logging and other functions are supported.

4.Thrift

is a scalable software framework for cross-language services. It has a powerful code generation engine that seamlessly supports C++, C#, Java, Python, PHP and Ruby. Thrift allows you to define a description file that describes data types and service interfaces. From this file, the compiler conveniently generates RPC client and server communication code.

Originally developed by Facebook for RPC communication between languages within the system, it was contributed to the Apache Foundation by Facebook in 2007 and is now one of the opensources under Apache. Support RPC communication between multiple languages: php client can construct an object, call the corresponding service method to invoke java language services, cross-language C/S RPC calls. The underlying communication is based on SOCKET.

5.Avro

From Doug Cutting, the father of Hadoop, Avro was launched at a time when Thrift was already quite popular, with the goal of not only providing a set of Thrift-like communication middleware, but also establishing a new, standard cloud computing data exchange and storage Protocol. HTTP and TCP are supported.

6.Dubbo

Dubbo is a high-performance excellent service framework open source by Alibaba, which enables applications to implement service output and input functions through high-performance RPC, and can be seamlessly integrated with Spring Framework.

Simple ways to use:

1. The interface to be called remotely needs to be registered in zookeeper;

2. The service that needs to be called remotely declares the interface it needs in zookeeper;

3. Zookeeper notifies the registered interface to the required service;

Thank you for reading this article carefully. I hope that the article "What are the differences between REST, SOAP and RPC" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support you a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report