神刀安全网

REST Constraints

In this article, we will discuss the different REST Constraints

REST Constraints

Client-Server:

  • This is the basic constraint for REST application
  • Client-Server enforces the separation of concerns in the form of a client-server architecture
  • The client and server handles their responsibility separately
  • A consumer invokes the service by sending the corresponding request message, and the service either rejects the request or performs the requested task before sending a response message back to the consumer

Cache:

All clients access the same server, and often requesting the same resources, it is necessary that these responses might be cached, avoiding unnecessary processing and significantly increasing performance.

This means that a first client requests a particular resource to the server, the server processes this request and stores it temporarily in the cache. When other clients request the same resource, the server returns what is in the cache without having to reprocess it.

The rule to clear the cache varies from resource to resource, and can be cleaned whenever there is a change of state in the resource.

Stateless:

The communication between client and server must be stateless. This means that each request from a service consumer should contain all the necessary information for the service to understand the meaning of the request, and all session state data should then be returned to the service consumer at the end of each request

Uniform Contract:

  • The Uniform Contract states that all services and service consumers within a REST-compliant architecture must share a single, overarching technical interface. As the primary constraint that distinguishes REST from other architecture types

Layered System:

  • The layered System principle states the client should never directly call the application server without first going through an intermediary. It can be a load balancer or any other machine that makes the interface between server(s).

    This ensures that the customer worries only about communication between the intermediary and the intermediary becomes responsible for distributing the requests on servers

Code-On-Demand:

  • Code-On-Demand intended to allow logic within clients to be updated independently from server-side logic

Thanks for visiting !!

© 2016,admin. All rights reserved.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » REST Constraints

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮