Javatpoint Logo
Javatpoint Logo

Difference between stateless protocol and stateful protocol

In this article, we will see the comparison between stateless protocol and stateful protocol along with their separate discussion. Both are the network protocols for web browsers and web servers. Both terms are differentiated based on the server-side to save session information.

This article will also be beneficial to students, as it may arise as a question in their examination. So, without any delay, let's start the topic.

Stateless protocol

In stateless protocol, the receiver must not keep session state from the past requests. These are the type of network protocols in which client sends the request to the server and the server responds according to the current state. It simplifies the server design and does not require many resources because there is no need to keep track of session details.

Stateless means each request is considered as the new request. In other words, server doesn't recognize the user by default. Every communication in stateless protocol is different.

Examples of stateless protocol are UDP, HTTP, etc. HTTP is a stateless protocol as both the client and server know each other only during the current request. Due to this nature of the protocol, both the client and server do not retain the information between various requests of the web pages.

Stateful protocol

It gives good performance to the client by keeping track of the connection information. It requires backing storage. Unlike the stateless protocol, in the stateful protocol, when a client sends a request to the server it expects some response, and if it does not get any response client resends the request.

If a transaction is interrupted in stateful protocol, we can pick up where we left off as the context and history have been stored. Stateful applications track setting preferences, window location, recent activity, etc.

Stateless protocol v/s Stateful protocol

stateless protocol vs stateful protocol

Now, let's see the comparison chart between stateful protocol and stateless protocol. Here, we are comparing both terms based on some characteristics.

S.no. Based on Stateless protocol Stateful protocol
1. Basic These are the type of network protocols in which client sends the request to the server and the server respond according to the current state. In stateful protocol, when a client sends a request to the server it expects some response, and if it does not get any response client resends the request.
2. Design It simplifies the server design. It makes the server design heavy and complex.
3. Dependency In stateless protocol, both server and client are independent and loosely coupled. While in stateful protocol, both server and client are tightly coupled.
4. Server restrictions In stateless protocol, server is not restricted to keep the server information or session details. In stateful protocol, server is not restricted to keep the server information or session details.
5. Example Examples of the stateless protocol are UDP (User Datagram Protocol), HTTP (Hypertext Transfer Protocol), etc. Examples of the stateful protocol are Telnet, FTP (File Transfer Protocol).
6. Transaction Transaction handling is fast in stateless protocol. Transaction handling is slower in stateless protocol.
7. Restoring after crash It works better during crash. This is because there is no need to restore any state. It is easy to restart a failed server after crash. It does not work better during crash. This is because server has to keep status information and session details.

So, that's all about the article. Hope you find it helpful and informative.


Next TopicDifference between





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA