Serviciile stateless nu stochează starea clientului între cereri (fiecare cerere este independentă), în timp ce serviciile stateful mențin starea. Lipsa stării este importantă pentru scalabilitate — serviciile stateless sunt mult mai ușor de scalat orizontal.
Serviciile stateless vs stateful
STATELESS → the service keeps NO client state between requests:
→ each request contains all needed info; any server can handle any request
→ state lives ELSEWHERE (database, cache, client, token) if needed
STATEFUL → the service MAINTAINS state across requests:
→ a specific server holds a client's state (session in memory, etc.)
→ requests must go to the SAME server (or state must be shared/synchronized)
