Thursday, February 28, 2013

REST and HTTP : Origin of REST continued ...........

Continuing from the last page REST and HTTP ......

Roy Fielding's New Web Architecture

  • Client - Server -  See REST and HTTP
  • Uniform Interface - See REST and HTTP
  • Stateless - All exchanges/communication between a client and server are stateless in nature. That is, each request contains all of the information necessary for a connector to understand the request, independent of any requests that may have preceded it. This restriction accomplishes four functions: 
    • It removes any need for the connectors to retain application state between requests, thus reducing consumption of physical resources and improving scalability; 
    • It allows interactions to be processed in parallel without requiring that the processing mechanism understand the interaction semantics;
    • It allows an intermediary to view and understand a request in isolation, which may be necessary when services are dynamically rearranged. It thus induces visibility
    • It forces all of the information that might factor into the re-usability of a cached response to be present in each request. 
        However this constraint imposes a trade-off. It decreases network performance by increasing      the repetitive data exchange. Also placing the application state in the client-side redues server's control over management of application state.
  • Cache - This constraint requires that the data send by the server in the response be explicitly tagged as cacheable or non-cacheable.If the response is cacheable then the client gets the right to re-use the data to serve subsequent requests.It improves efficiency, scalability and user-perceived performance by reducing the average latency of a series of requests. However the disadvantage is that it decreases reliability, when the cached data becomes stale and does not match the data on the server. This may occur when the resource on the server gets modified while the cache is still awaiting to be updated with the current resource state on the server.
  • Layered System - The layered system constraints enable network-based intermediaries such as proxies and gateways to be transparently deployed between a client and server using the Web’s
    uniform interface. Intermediate layers can  be used to improve system scalability by enabling load balancing of services across multiple networks and processors.The combination of layered system and uniform interface constraints induces architectural properties similar to those of the uniform pipe-and-filter style . Intermediary components can actively transform the content of messages because the messages are self-descriptive and their semantics are visible to intermediaries.
  • Code-On-Demand - This constraint allows clients to download code, scripts or plugins from the server , which then can be executed by the client. This simplifies clients by reducing the number of features required to be pre-implemented. However, it also causes technology coupling between client and server as the client must have the expertise to execute the downloaded code.


The above Web Architectural Style composed of the constraints already outlined, was named
and described by Fielding in his Ph.D. dissertation as “Representational State Transfer” (REST) .

No comments:

Post a Comment