Search This Blog

REST - Representational State Transfer

Representational State Transfer

Year 1996

Berners-Lee writes that the "Web's major goal was to be a shared information space through which people and machines could communicate."

Year 2000

Hypermedia was chosen as the user interface because of its simplicity and generality. Hypermedia, an extension of the term called hypertext, is a non-linear medium of information that includes graphics, audio, video, plain text, and hyperlinks. A non-linear medium is any medium that can be navigated through random access.The rapid growth of the Internet and the consequently deployed architecture had significant limitations in its support for extensibility, shared caching, and intermediaries, which made it difficult to develop ad-hoc solutions to the growing problems.The challenge was to introduce a new set of functionality to an architecture that was already widely deployed, and how to ensure that its introduction does not adversely impact, or even destroy, the architectural properties that have enabled the Web to succeed.The early Web architecture was based on solid principles--separation of concerns, simplicity, and generality--but lacked an architectural description and rationale. An architectural style could define the principles behind the Web architecture such that they were visible to future architects.

REST - Representational State Transfer

REST is an architectural style for distributed hypermedia systems, as it has been developed to represent the model for how the modern Web should work.REST provides a set of architectural constraints that, when applied as a whole, emphasizes scalability of component interactions, the generality of interfaces, independent deployment of components, and intermediary components to reduce interaction latency, enforce security, and encapsulate legacy systems.

Constraints

The following constraints are applied incrementally

Client Server

Results in the separation of two concerns and allow them to evolve independently.

Stateless

In a client-server interaction, the communication must be stateless. The client should carry all the session state necessary for any interaction with the server and should not rely on the server storing any such context.

(+) Improves scalability

(+) Simplifies server

(-) Increased network latency

Cache

In order to improve network latency, responses should be labeled as cacheable or non-cacheable.

(+) Improves latency in some cases

(-) Chances of client reading stale information

Uniform Interface

Uniform interface for interaction improves generality of a software and it decouples an implementation from its interface. It is an optimal decision with entire ‘Web’ in mind. It may be optimal for a system and may not be optimal for a particular application.

(+) Allows implementations to evolve independently

(-) May not result in an optimal communication for some applications

Constraints for a uniform interface

Identification of resources

Manipulation of resources through representations

Self-descriptive messages

Hypermedia as the engine of application state (HATEOAS)

Layered System

Hierarchical layers, where a component of a layer cannot see anything beyond its immediate layer.

(+) This allows underlying layers to evolve independently

(-) Increased latency

Code on Demand

REST allows client functionality to be extended by downloading and executing code in the form of applets or scripts. This is an optional constraint.

(+) Simplifies client

(+) Improves extensibility

(-) Reduces Visibility

Architectural Elements

Data Elements

Resource - A conceptual target of a hypertext reference. Any information that can be named is a resource.

Post a comment

Popular posts from this blog

Hadoop HDFS - 2007 - A distributed file system for reliably storing huge amounts of unstructured, semi-structured and structured data in the form of files. Hadoop MapReduce - 2007 - A distributed algorithm framework for the parallel processing of large datasets on HDFS filesystem. It runs on Hadoop cluster but also supports other database formats like Cassandra and HBase. Cassandra - 2008 - A key-value pair NoSQL database, with column family data representation and asynchronous masterless replication. HBase - 2008 - A key-value pair NoSQL database, with column family data representation, with master-slave replication. It uses HDFS as underlying storage. Zookeeper - 2008 - A distributed coordination service for distributed applications. It is based on Paxos algorithm variant called Zab. Pig - 2009 - Pig is a scripting interface over MapReduce for developers who prefer scripting interface over native Java MapReduce programming. Hive - 2009 - Hive is a SQL interface over MapReduce for de…

What is Software Architecture? Software Architecture is the structure of a software system, it's fundamental properties and the principles of its design and evolution. Structure: It is about identifying the architecturally significant pieces of a system and defining the relationship between them. Properties: It is about the functional properties of a system and its quality properties like performance, scalability, security, etc. Principles: It is about understanding the principles behind its design. An understanding that allows the system to evolve in a consistent and logical way without introducing unnecessary complexity. What is the importance of Software Architecture?
The need for Software Architecture is best summarized in the following statement: "Software architecture represents a system's earliest set of design decisions. These early decisions are the most difficult to get correct and the hardest to change later in the development process, and they have the most far-reac…