What stateless means
A stateless service keeps no client specific data between requests inside the process. Everything needed to handle a request arrives in the request or is fetched from a shared store.
Why it matters
- Interchangeable nodes: a load balancer can send a request to any instance because none holds special memory of the client.
- Easy scaling: add or remove instances freely, since no node owns a user.
- Fast recovery: a crashed node loses nothing important because state lives elsewhere.
Where the state goes
- Session stores like Redis hold login and cart data keyed by a token.
- Databases hold durable records.
- Tokens such as signed cookies carry small state with the client itself.
Common traps
- Sticky sessions pin a user to one node and quietly reintroduce state, hurting failover.
- In memory caches that are not shared cause inconsistent answers across nodes.
Key idea
A stateless service externalizes all client state, so every instance is interchangeable and the system scales and recovers by simply adding or replacing nodes.