The Wayback Machine - https://web.archive.org/web/20240811070704/https://www.geeksforgeeks.org/what-is-a-stateless-server/
Open In App

What is a stateless server ?

Last Updated : 27 Mar, 2022
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

As the name suggests, the stateless server has no state with regard to the user’s information. It means when the user access any web resource, the server does not keep a track of the user’s identity or actions performed on the page. So every time, the user has to prove the identity to gain access.

Let’s understand it better in contrast with the stateful server. Stateful servers store users’ state information in the form of sessions. It stores information like profile, preference, user’s action and gives personalized experience on next visit. The user does not need credentials every time during the valid session.  

While stateless server treats each request as independent and demand user credentials. It requires no knowledge of previous interactions and stores no session information. So, there’s no difference between previous, current, and next requests.

Features of Stateless Server:

Performance: The server is not bound to maintain and synchronize any session data.  So it can serve any number of requests to the user. It helps in achieving a better response time with experience.  

Design: This is regarded as an advantage for developers as the stateless servers are easy to design and code because there is no need to dynamically maintain storage units in the backend. Stateless authentication uses REST (Representational State Transfer) to design the web APIs.  

Data Crash: Since no data is stored on the server, there is nil impact of a system crash on the performance of the web resource. The user can simply recover the access by reauthenticating. Stateless uses a different server on each request. So there’s a scope of horizontal expansion.

Technology: The stateless servers can identify users based on a unique ID called Tokens. Tokens accommodate essential information of the user grants access after receiving the secret token. The validity of the token depends either on session duration or it gets destroyed once the user logs out of resource. This technology is known as cryptography which is going to be a major driver of future security mechanisms.

How does Stateless Server Works?

User visits a web page and the client-side interface on detecting a user responds with a credential window. The user gives a username, password and submits it for authentication. The server verifies the credentials from Database and gives access to the user. The server gives a unique token to verify the identity. The user on the next request can use the token to gain entry into the resource. This eliminates the need for the server to store information.

Here, the responsibility of authentication lies with the user who has to input the digital key to gain access and the database to match the key with the information. The information is stored in the database, not in the server, so the client has to make a call to the database every time manually either using credentials or a token.

The common way to identify users is through JASON Web Token (JWT) / OAuth stored on the client-side. This way the server relies on the user with a new request and does not rely on information from the earlier request.

Conclusion: So far we have covered the major know-hows of the Stateless model and its role in ensuring the security of the data. HTTP is known as a stateless server for the reason it demands the user’s identity on every visit. Hence, we can say that a stateless server is a modern aspect of web resources that are more critical from a security perspective.



Similar Reads

How to access props.children in a stateless functional component in ReactJS ?
The {props. children} allows you to create a generic template, which can be modified by a parent when invoked. In this way, a parent component can easily pass whatever is necessary to its child, even generated layout features. Anytime you call a component, it automatically displays whatever it has between its opening and closing tags. A component w
5 min read
Difference between Apache Tomcat server and Apache web server
Apache Tomcat server: Apache Tomcat is a web container. It allows the users to run Servlet and JAVA Server Pages that are based on the web-applications. It can be used as the HTTP server. The performance of the Tomcat server is not as good as the designated web server. It can be used as separate product with its own internal Web-server. It can also
2 min read
Difference between Web Server and Mail Server
Web Server : Web Server, as the name suggests, is a server software where web content is stored and uses HTTP protocol and other protocols to respond to user requests that is being made over WWW. Its main function is to display the content of the website through storing, processing, and delivering webpages within the website to users. Example: Apac
4 min read
How to install and configure Apache Web Server on Godaddy Server?
GoDaddy VPS is a shared server that provides computational services, databases, storage space, automated weekly backups, 99% uptime, and much more. It’s a cheaper alternative to some other popular cloud-based services such as AWS, GPC, and Azure. Apache HTTP Server is an open-source web server software widely used by web hosting companies to provid
2 min read
Server Side Rendering vs Client Side Rendering vs Server Side Generation
In the world of web development, there are several approaches to rendering web pages: server-side rendering, client-side rendering, and server-side generation. Each approach has its own advantages and disadvantages, and choosing the right one for your project depends on your specific needs and goals. In this blog, we’ll explore the differences betw
4 min read
Difference Between Web server and Application server
A server is a central repository where information and computer programs are held and accessed by the programmer within the network. Web server and Application server are kinds of the server which employed to deliver sites and therefore the latter deals with application operations performed between users and back-end business applications of the or
2 min read
How to Install Apache Web Server on Linux Cloud Server?
Apache is an open-source web server used widely for hosting websites and web applications. It's popular on the internet and supports platforms like Linux, Windows, and macOS. Installing Apache on a Linux-based cloud server is straightforward. Cloud servers offer flexibility and scalability, enabling easy management and deployment of computing resou
5 min read
Create a web server and run PHP script on it using Raspberry Pi
In this post, creating a web server and running PHP script on it using Raspberry Pi will be discussed. Web Servers are basically simple computer programs that dispense the web page when they are requested using the web client. The machines on which this program run are usually called as a server, with both the names web server and server almost use
2 min read
Bootstrap 5 Validation Server side
Bootstrap 5 Validation Server side provides valuable, actionable feedback to your users by browser default behaviors or custom styles and JavaScript. If you are using server-side validation, you can indicate invalid and valid form fields with .is-invalid and .is-valid and add .invalid-feedback & .valid-feedback with these classes it is a supported
3 min read
Node.js Automatic restart Node.js server with nodemon
We generally type following command for starting NodeJs server: node server.js In this case, if we make any changes to the project then we will have to restart the server by killing it using CTRL+C and then typing the same command again. node server.js It is a very hectic task for the development process. Nodemon is a package for handling this rest
1 min read
three90RightbarBannerImg