Cloud Session Handover via External Storage
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In cloud computing environments, shutting down application instances while maintaining session state integrity is challenging due to long-running sessions, leading to disruptions and inefficiencies, especially during scaling, maintenance, and availability zone evacuations.
Innovation Solution
A coordinated shutdown method involving a shutdown coordinator that sends instructions to routers and application instances to hand over sessions to new instances, allowing seamless session transfer and eventual shutdown of the original instance, with session state being exported and imported efficiently.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If application instances are shut down quickly to improve shutdown speed and resource efficiency, then productivity is improved, but session state is lost causing user disruptions and reliability deterioration
Solution Approach 1:
The system performs preliminary actions by exporting session state from the application instance to external session storage before the shutdown process begins. This allows the application instance to be stopped quickly while preserving user session data, eliminating the trade-off between shutdown speed and session integrity.
2Reliability
If sessions are drained before shutdown to maintain session state, then reliability is improved, but shutdown time increases reducing productivity
Solution Approach 1:
The session state is extracted from the application instance and stored in external session storage. This separation allows the application instance to be shut down immediately without waiting for session draining, as the session data is already preserved externally.
3Reliability
If session handover is implemented to maintain service continuity, then reliability is improved, but system complexity increases
Solution Approach 1:
A shutdown coordinator component is introduced as an intermediary to manage the session handover process. It coordinates between the application instance, router, and external session storage, centralizing the complexity in a dedicated component rather than distributing it throughout the system.
4Reliability
If sticky sessions are maintained during handover to preserve user context, then session state integrity is improved, but redirect complexity increases
Solution Approach 1:
The session state is copied to external session storage with a reference to the original application instance. During handover, the router uses this stored state to redirect requests to the new application instance, maintaining sticky sessions without complex redirect logic in the application layer.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
In an implementation, a shutdown coordinator sends an instruction to a router to no longer assign new sessions to an application instance, where the application instance is to be shut down. The shutdown coordinator sends a request to the application instance to export associated sessions for handover to a new application instance. The shutdown coordinator receives an indication from the application instance that no further requests can be processed by the application instance since all associated sessions have been exported to an external session storage. The shutdown coordinator instructs the router to redirect requests to the application instance to the new application instance. The shutdown coordinator shuts down the application instance. The shutdown coordinator deletes remaining sessions of all associated sessions from the external session storage after a defined timeout period.