Stateless services

A stateless server keeps no session data between requests, so any instance can answer any user. Sessions go to a shared cache or a signed token, which is what makes horizontal scaling and auto-scaling possible.

Where it shows up in real systems

  • Virtual machine

    Throughput grows with vCPUs and depends on the runtime: Go serves several times more requests per core than Python. If memory is below what the runtime needs, the machine swaps and slows down sharply. Several instances behind a load balancer survive the loss of one.

    In production: Amazon EC2, Azure Virtual Machines, Google Compute Engine, OVHcloud Public Cloud

  • Real-time gateway

    Chat, live scores and collaborative editing need the server to talk first. Persistent connections are stateful: each user is pinned to one gateway node, so a node failure forces reconnections and a presence store is needed to know who is online where.

    In production: AWS API Gateway WebSocket, Socket.IO, Phoenix Channels, Centrifugo, Pusher, Ably

See it break, then fix it

Build an architecture, send it a day of traffic and outages, and learn why it holds or fails. Free to start.