Thursday, March 16, 2017

REST Architecture Constraints

In this post, we will understand what is the REST? and What are the architecture Constraints for the REST

What is REST?

Representational State Transfer (REST) is a software architecture style consisting of guidelines and best practices for creating industry standard web services

What are the Constraints?

  • Uniform Interface
  • Statelessness (State to handle the request is contained within the request itself)
  • Client-Server
  • Cache
  • Layered System
  • Code on Demand


Uniform Interface
     Client should easily understand the interface, it should be uniform for all the clients(web,mobile)
Example
http://domain/api/HotelBooking/Book


Statelessness
Every Request to the server should pass all the required information. REST primarily uses HTTP Protocol which support the statelessness

Client-Server
    Maintain the clear separation between client and server. client and Server should have different code and changing one place shouldn't affect the other end

Cache
    Provide an ability to cache the response in the client side or if any middleware

Layered System
   It supports the multi layer architecture and it should allow to add/remove any additional layer without breaking the functionality

Code on Demand
    Allow independent code updates on both client(web browser upgrade) and server side(Database layer change)





No comments:

Post a Comment