Stateless protocol

In computing, a stateless protocol is a communications protocol that treats each request as an independent transaction that is unrelated to any previous request so that the communication consists of independent pairs of requests and responses. A stateless protocol does not require the server to retain session information or status about each communications partner for the duration of multiple requests.

An example of a stateless protocol is the Hypertext Transfer Protocol (HTTP) which is the foundation of data communication for the World Wide Web.

Advantages and Disadvantages

The stateless design simplifies the server design because there is no need to dynamically allocate storage to deal with conversations in progress. If a client dies in mid-transaction, no part of the system needs to be responsible for cleaning the present state of the server.

A disadvantage of statelessness is that it may be necessary to include additional information in every request, and this extra information will need to be interpreted by the server.

Examples

An example of a stateless protocol is HTTP.[1] The protocol provides no means of storing a user's data between requests. As a work-around, HTTP servers implement various session management methods,[2] typically utilizing a unique identifier in a cookie or parameter that allows the server to track requests originating from the same client.

Contrast this with a traditional FTP server that conducts an interactive session with the user. During the session, a user is provided a means to be authenticated and set various variables (working directory, transfer mode), all stored on the server as part of the user's state.

References

  1. ^ http://www.w3.org/Protocols/rfc2616/rfc2616.html
  2. ^ "session management methods reviewed". http://cookiebits.com/: C cookie bits. "The following material is intended to introduce the reader to the various techniques that developers have used to implement session tracking on the Web. The main operational characteristics of each method are mentioned in addition to the shortcomings that have been observed in usage. Additional information on session management can be found by searching the Internet. […]"