Stateless services ले अनुरोधहरू बीच client state भण्डारण गर्दैन (प्रत्येक अनुरोध स्वतन्त्र छ), जबकि stateful services ले state कायम राख्छन्। Statelessness scalability को लागि महत्त्वपूर्ण छ — stateless services को क्षितिज अनुसार scale गर्न धेरै सजिलो छ।
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)
