Interview Prep/Real-World Interview/Scaling and performance

Your app servers need sticky sessions, which breaks autoscaling. How do you fix it?

BeginnerScenarioScaling and performance
Answer

Situation read → State held in the app's memory ties users to one instance. Scaling in drops sessions, scaling out doesn't rebalance.

What I'd do →

  1. Move session state out of the process: Redis or ElastiCache, or stateless JWT tokens.
  2. Remove stickiness from the load balancer once sessions are external.
  3. If it can't be removed yet, use ALB duration-based stickiness with a short duration and connection draining, and accept some rebalancing cost.
  4. Test: kill a pod mid-session and confirm the user stays logged in.

Why → Stateless app tiers are what make horizontal scaling and zero-downtime deploys work.

Interview tip → Say "externalise the state" before discussing load balancer settings.

All Real-World Interview questions Roadmap: Interview readiness

More on Scaling and performance