Software Development - (Stateless|Stateful)
Table of Contents
1 - About
Stateless or state-full refers to the fact that a unit of program (process, function, procedure) have a state or not (Ie variable that may change).
2 - Articles Related
3 - Type
3.1 - Stateless
Parallel aggregate operations over a variety of data sources, including even non-thread-safe collections such as ArrayList. are possible only if we can prevent interference with the data source during the execution. For most data sources, preventing interference means ensuring that the data source is not modified at all during the execution.
Statless pocess are:
The process may be started, stopped, or restarted at any time. See Software Design - Recovery (Restartable)
3.2 - Stateful
Execution results may be non-deterministic or incorrect if the behavioral parameters to the operations are stateful.
A stateful parameter is one whose result depends on any state which might change during the execution. The results for the same input could vary from run to run, due to thread scheduling differences, whereas, with a stateless expression the results would always be the same.
The best approach is to avoid stateful behavioral parameters entirely; there is usually a way to restructure the pipeline to avoid statefulness.