Tutorials / Tech blog / Geek Zone

Latest Posts

REST :: Introduction

Wiki states...

"Representational State Transfer (REST) is a software architectural style that defines a set of constraints to be used for creating web services."

In a nutshell it defines how applications communicate over HTTP (Hypertext Transfer Protocol). The concept defined as "RESTful" systems was coined by Dr. Roy Fielding in his 2000 PhD dissertation thesis "Architectural Styles and the Design of Network-based Software Architectures."

In a retrospective look at the development of REST, Fielding said:

This architectural style helps us make flexible architectural choices which can be very well leveraged to design a system with desirable properties.

In today's world, almost every application needs to communicate with other applications. Hence its of paramount importance that applications are designed to communicate with other applications without depending on the programming language or the operating system.

RESTful API (mostly referred as REST web service) is implemented using HTTP protocol. 
HTTP methods (most common) such as GET / POST / PUT / DELETE / PATCH / HEAD / OPTIONS are used.

Verb Description
GET Returns an entity in response to the requested resource
POST Returns an entity describing the outcome of the action
PUT Stores a new or updated entity at a URI ( Uniform Resource Identifier)
DELETE Request that a resource is removed now or later
PATCH Updates only the specified fields of an entity at a URI
HEAD Returns the entity's header field related to the requested resource
OPTIONS Interrogates a server about a resource by asking what other verbs are applicable

REST web services rely on stateless protocol & standard operations for optimal performance, reliability & ability to scale thereby leveraging reusable components which can be easily maintained in silos thereby avoiding any impact to the rest of the running system.

Following are the 6 Architectural guiding constraints which define a RESTful system.
  • Client-Server Architecture
  • Statelessness
  • Cacheability
  • Layered System
  • Code on demand
  • Uniform Interface
By abiding to these constraints we can assure that the underlying application will inhibit the following properties
  • Performance
  • Scalability
  • Simplicity
  • Modifiability
  • Visibility
  • Portability
  • Reliability

No comments:

Post a Comment