Interview Prep/Networking/Load balancers and reverse proxies

Behind a load balancer, users get logged out randomly or lose their cart between clicks.

BeginnerTroubleshootingLoad balancers and reverse proxies
Answer

Likely causes → Sessions are stored in the memory of each app instance, and the LB spreads requests across instances. Each request may land on an instance that doesn't know the session.

Diagnose →

curl -s -c /tmp/c -b /tmp/c -I https://app.example.com/ | grep -i -E 'set-cookie|x-served-by'
# repeat a few times and see if the backend changes along with the session

Fix → Short term: enable stickiness (ALB stickiness.enabled=true with lb_cookie). Proper fix: move sessions to a shared store (Redis, database) or use stateless signed tokens, so any instance can serve any request.

Prevent → Design apps stateless from day one; stickiness hurts scale-in and uneven load.

All Networking questions Roadmap: Networking for DevOps

More on Load balancers and reverse proxies