The deciding question: does this input need history?
How dependence on retained context distinguishes stateful from stateless processing, independently of database use or ACID guarantees. · associate
Stateful processing handles a new input using context retained from earlier inputs. A running purchase total needs the previous total; recognizing a repeated event needs a record of identifiers already seen. That retained information is state. Without it, the operation cannot produce the required result correctly.
Stateless processing handles inputs independently of previously processed inputs. Converting a temperature using the value in the current record, or filtering a record using its own fields, requires no remembered history. Temporary variables used during one operation do not make processing stateful.
Choose by the dependency, not by the amount of code or the hosting service. Ask: does this operation need context from earlier inputs that is not supplied in the current input? If yes, the processing is stateful. If the current input supplies everything needed for an independent transformation, it can be stateless.