Sticky sessions

Sending a user always to the same server lets it keep session state in memory. It breaks even load distribution and loses sessions when that server dies, so prefer stateless services.

Where it shows up in real systems

  • Application load balancer

    It terminates TLS, routes by path or host and stops sending traffic to an instance that fails its health checks. The algorithm matters: least-connections absorbs uneven requests better than round robin, and sticky sessions create hot spots.

    In production: AWS Application Load Balancer, NGINX, Envoy, HAProxy, Azure Application Gateway

  • 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.