Exercise 3: Why the Autoscaling Event Caused Session Loss Despite Sticky Sessions — Possible Solution ==================================================================== WHAT WAS CORRECTLY CONFIGURED, AND WHAT WASN'T ------------------------------ Per this chapter's worked example, "sticky sessions are configured - but the application was never using a shared session store, only local, per-server memory." Sticky sessions themselves were working correctly - the missing piece was that session data still lived only on whichever single server originally handled each user's login. WHY ADDING NEW SERVERS CAUSED A REASSIGNMENT ------------------------------ Per this chapter, "many load balancers redistribute existing connections across the new, larger pool of backends when the pool itself changes - exactly what happened here, reshuffling a portion of users onto instances that had never seen their session before." Adding new server instances changed the total pool the load balancer distributes traffic across, and as part of accommodating that change, some users who were previously stuck to one of the original servers got reassigned to one of the new ones. WHY THAT REASSIGNMENT CAUSED SESSION LOSS ------------------------------ A user reassigned to a new server was now being routed to a server that had no record of their session at all, since that session had only ever existed in the original server's own local memory. Per this chapter, "their local-only session simply didn't exist on the new server, and they were silently logged out" - the sticky-session mechanism itself worked exactly as designed; it was the underlying local-only storage that made a routing change equivalent to a total session loss for the affected users. WHY THIS WORKS AS AN ANSWER ------------------------------ It separates what worked correctly (sticky-session routing) from what caused the actual failure (local-only session storage), and explains the specific mechanism (load balancer redistribution during scaling) that connected the autoscaling event to session loss for a subset of users.