What are sticky sessions and why would you avoid them?
BeginnerScenarioLoad Balancing, Proxies & CDN
Answer
Situation read → Stickiness pins a client to one backend, usually via a cookie.
What I'd do →
- ALB stickiness uses
AWSALBcookie, enabled per target group withstickiness.enabled=true - Use only if the app keeps session state in memory
- Better: move session state to Redis or use signed JWTs so any node can serve any request
- Without stickiness, scaling in and rolling deployments are smooth
Why → Stickiness leads to uneven load and lost sessions when a node dies.
Interview tip → Say stateless services are the real answer; stickiness is a tactical workaround.
More on Load Balancing, Proxies & CDN
What is the difference between a Layer 4 and a Layer 7 load balancer?BeginnerWhen do you choose an ALB and when an NLB in AWS?BeginnerForward proxy versus reverse proxy: what is the difference?BeginnerHow do health checks work on a load balancer and what makes a good one?BeginnerWhat does a CDN do and when does it help?BeginnerYour app sees the load balancer's IP instead of the real client IP. How do you get the real one?Beginner