Open In App

RESTful Statelessness

REST is an acronym for REpresentational State Transfer and an architectural style for distributed hypermedia systems.

The six guiding principles or Constraints of REST are:



  1. Uniform Interface
  2. Client-Server
  3. Stateless
  4. Cacheable
  5. Layered architecture
  6. Code on demand (optional).

We will discuss the Stateless constraint of REST in-depth in this article.

NOTE: As per the REST{Representational “State” Transfer } architecture, the server does not store any information about the client-side on the server-side.



Each request from the client to server must contain all the information needed to process that request and that information cannot be stored at the server side for any future reference. This restriction is called Statelessness.

The client is responsible for storing and handling the session-related information on its own side. If any information is required from the previous request, the client will share it in the current request.

Statelessness means that every HTTP request happens in complete isolation”.

Application state is the information stored at the server side to identify incoming requests and previous interactions, REST statelessness means being free from the application state.

Advantages of REST Statelessness:

Disadvantages of REST Statelessness:

EXAMPLE of Statelessness:

Suppose we have an API where we want to log in and order some goods, the API deployed on many servers can serve many requests, even from the same account without storing the authentication details or provided token state.

Every time client is making a request it will send the authentication details as well as the other required information and that request can be processed easily at the server side as it includes all the information needed to fulfill the request.

Article Tags :