บริการแบบ stateless ไม่จัดเก็บสถานะของ client ระหว่างคำขอ (แต่ละคำขอเป็นอิสระ) ในขณะที่บริการแบบ stateful จะรักษาสถานะไว้ ความเป็น stateless มีความสำคัญต่อ scalability — บริการแบบ stateless ทำ horizontal scaling ได้ง่ายกว่ามาก
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)
