What is the difference between REST and SOAP, RPC?

Source: Internet
Author: User

First question: 什么是RESTful ?

The word rest is from Roy Thomas Fielding in his 2000 doctoral dissertation. Interested to see the paper here ', who is fielding? Click on the previous name to learn.

RESTfulWhat the hell is that? In a nutshell, it is: 一种架构设计风格,提供了设计原则和约束条件 , not architecture. The application or design that satisfies these constraints and principles is the RESTful architecture or service.

Recommended reading: Zhang Shanyu Blog--rest Introduction

infoq--in Layman's rest

Second question:到底 REST 和 SOAP、RPC 有何区别?

The problem is bigger, you know what the difference between them first need to understand, they are what?

    • RESTThe above is a simple explanation of what it is.

    • SOAPWhat is a simple Object access protocol? SOAP是一种数据交换协议规范,是一种轻量的、简单的、基于XML的协议the specification. What advantages does it have? A simple summary is: 易用,灵活,跨语言,跨平台 .

      Ease of use: because its messages are based on xml and encapsulated as compliant http protocols, it conforms to the requirements of any router, firewall, or proxy server.

      Flexible: Highly scalable, soap eliminates the need to disrupt existing applications, and SOAP clients, servers, and protocols can evolve themselves. And soap is a great way to support intermediate media and hierarchical architectures.

      Cross-language: soap It can be done in any language, as long as the correct request is sent soap .

      Cross-platform: soap Service-based services can be used without modification on any platform.

    • RPC(远程调用框架)is a mechanism that allows distributed applications to invoke services available on different computers on the network. Do not have much to dabble in, omit 256 words at a moment. There are familiar friends that can be added in the comments and then I will revise to that content to go

From the above we can see, REST 和 SOAP、RPC 有何区别 what? There is no big difference, their essence is to provide a basic service that can support distributed, the biggest difference is the different application scenarios brought by their respective characteristics.

RESTCan be looked at is a http direct application of the protocol, the default based on json as a transmission format, easy to use, learning cost inefficient, ~ ~ But the security is lower ~ ~, and SOAP can be looked at is a heavyweight protocol, based on xml , SOAP in the security of the use XML-Security of and XML-Signature two specifications made up WS-Security to achieve security control, has been supported by various manufacturers,. NET, PHP, Java has been very good support. This is a REST weak place.

What is a PC (remote procedure Call)

    • In a nutshell, RPC invokes a function or method (collectively referred to as a service) on the other machine (the server) on a machine (client), which is passed as a parameter, and results are returned.
    • RPC hides the underlying communication details (no need to process socket or HTTP traffic directly)
    • RPC is a request response model. The client initiates the request and the server returns a response (similar to how HTTP works)
    • RPC calls a remote function (or method) as if it were called a local function (or method).
    • Each has its own usage scenarios. If you create a distributed service that requires good security, you can consider soap if you require strong customization for the underlying implementation such as transport, and if the design implementation is simple, generally security requirements are not high enough to consider rest. This is only a general case, but the use of rest for resource-oriented services has a natural advantage.

What is the difference between REST and SOAP, RPC?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.