Stateless ਸੇਵਾਵਾਂ ਬੇਨਤੀਆਂ ਦੇ ਵਿਚਕਾਰ ਕਲਾਇੰਟ ਸਥਿਤੀ ਨੂੰ ਸਟੋਰ ਨਹੀਂ ਕਰਦੀਆਂ (ਹਰੇਕ ਬੇਨਤੀ ਸੁਤੰਤਰ ਹੈ), ਜਦੋਂ ਕਿ stateful ਸੇਵਾਵਾਂ ਸਥਿਤੀ ਨੂੰ ਬਣਾਈ ਰੱਖਦੀਆਂ ਹਨ। Statelessness ਸਕੇਲੇਬਿਲਿਟੀ ਲਈ ਮਹੱਤਵਪੂਰਨ ਹੈ — stateless ਸੇਵਾਵਾਂ ਨੂੰ ਲੇਟੀਜ ਰੂਪ ਵਿਚ ਸਕੇਲ ਕਰਨਾ ਬਹੁਤ ਆਸਾਨ ਹੈ।
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)
