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-server, Stateless, 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
is portableClient stands independent from different user interfaces.Server
Stateless :
- Self-containing messages, no client state on the server
- For the particular operation, each message contains information
does not need to keep the server information or session detailsServer - Loosely coupled client and the server.
- Handles transactions immediately with a quick manner
- Can act independently
- REST services are
cacheable - Resources which returns from the server is
cacheable can cache resources (Implicit caching)Client Server should decide what and how should be cashed (Explicit caching)
Uniform Interface :
- Based on the HTTP specifications
- Uses hypermedia to better
throughnavigation .resources
is decoupled and enough to have multiple layers and intermediate services between client and serverServer - Highly scalable
Code on demand :
- Only optional constraint
- Allows the client to improve the flexibility
- The client can download a JavaScript,
applet or even a flash application in order to encryptjava 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
Comments
Post a Comment