Stateless services विनंत्यांमधील क्लायंट स्टेट संग्रहित करत नाहीत (प्रत्येक विनंती स्वतंत्र आहे), तर stateful services स्टेट राखतात. Statelessness स्केलेबिलिटीसाठी महत्वाचे आहे — stateless services क्षैतिजरित्या स्केल करणे खूप सोपे आहे.
Stateless विरुद्ध 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)
