Home > State Management Explained > Stateless and Stateful

Stateless and Stateful

During the design stage of a service, we are very interested in what will happen when the service is active. We are so interested, in fact, that we have additional states to represent specific types of active conditions. In relation to our discussion of state management, there are two primary conditions:

  • stateless
  • stateful

These terms are used to identify the active or runtime condition of a service as it relates to the processing required to carry out a specific task. When automating a particular task, the service is required to process data specific to that task. We can refer to this information as state data.

A service can be active but may not be engaged in the processing of state data. In this idle condition, the service is considered to be stateless. As you may have guessed, a service that is actively processing or retaining state data is classified as being stateful.

A classic example of statelessness is the use of the HTTP protocol. When a browser requests a Web page from a Web server, the Web server responds by delivering the content and then returning to a stateless condition wherein it retains no further memory of the browser or the request (unless programmed otherwise).