REST Services And Express JS

REST Services And ExpressJS(Part 01)

What is the REST Services?

Simply it is the abbreviation of the REpresentational State Transfer Protocol. This is the architectural style for distributed hypermedia systems. REST also has its own guiding constraints which must be satisfied if an interface needs to be referred as RESTful like other architectural styles.
As guiding principles of REST, there are 6 principles. Those are  Client-serverStateless, Cacheable, Uniform interface, Layered system, Code on demand (optional)

Client-Server  : 
  • Separates the user interface and services
  • Uses URI to make the connection between the client and the user
  • HTTP stack is the communication platform
  • Client is portable
  • Server stands independent from different user interfaces.
Stateless  : 
  • Self-containing messages, no client state on the server
  • For the particular operation, each message contains information 
  • Server does not need to keep the server information or session details
  • Loosely coupled client and the server.
  • Handles transactions immediately with a quick manner
  • Can act independently
Cacheable : 
  • REST services are cacheable
  • Resources which returns from the server is cacheable
  • Client can cache resources (Implicit caching)
  • Server should decide what and how should be cashed (Explicit caching)
Uniform Interface  :
  • Based on the HTTP specifications
  • Uses hypermedia to better navigation through resources.
Layered System  : 
  • Server is decoupled and enough to have multiple layers and intermediate services between client and server
  • Highly scalable
Code on demand  :
  • Only optional constraint
  • Allows the client to improve the flexibility
  • The client can download a JavaScript, java applet or even a flash application in order to encrypt communication
  • Reduces visibility
The architecture of REST Services

In REST services resources are identified by the URI. Resources in the REST services are the key abstraction of information. Multiple URIs can be referred to the same resource. To pass the data JSON and XML are used. As the special features being lightweight, having the scalability and being maintainable can be identified.

What is HTTP Messseges ?

HTTP and REST are not same. Data exchange between the server and the client is the representation of what HTTP messages are. HTTP is based on the client-server architecture and stateless request and response protocol. Basically, these modal and the protocols operate by exchanging messages across a reliable TCP/IP connection.

What is Express JS ?

Express JS is a web application framework. It provides a simple API to build websites , web apps and back ends. This provides the minimal interfaces to build the applications.It is flexible with the numerous modules available on npm.
Express JS was developed by TJ Holowaychuk and is maintained by the Node.js.

Comments

Popular posts from this blog

"status": 404, "error": "not found", "message": "no message available", "path": "/api/employee"

There was an unexpected error (type=Not Found, status=404). No message available in Springboot