Session Data Persistency via Snapshot Delta Comparison
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In distributed data processing systems, session-based data persistency is challenging due to issues with stateful server nodes handling multiple requests without re-authentication, especially when load balancers redirect requests to different server nodes, leading to inconvenience and potential data loss due to lack of session replication and high memory consumption.
Innovation Solution
Implementing a method where an executing computing server captures a current snapshot of session data, compares it to a past snapshot stored by a persistence layer, and updates session attributes asynchronously to enable seamless service execution across server nodes without re-authentication, using a whitelist of modifiable attributes to optimize storage and performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If session data is maintained on server nodes without persistence, then memory consumption is reduced and system simplicity is maintained, but session data is lost when requests are redirected to different server nodes
Solution Approach 1:
A persistence layer is introduced as an intermediary component between server nodes and session data. This layer stores session snapshots externally, allowing server nodes to retrieve and restore session data when requests are redirected, without requiring complex inter-node communication or shared memory systems.
Solution Approach 2:
Session data is proactively saved as snapshots in the persistence layer before potential server node failures or redirects occur. This preliminary action ensures that session information is already available and can be quickly restored without requiring complex real-time synchronization mechanisms.
2Reliability
If complete session snapshots are stored for every request, then data availability is improved, but storage efficiency deteriorates due to redundant data
Solution Approach 1:
Only the changed portion of session data (delta) is extracted and stored in the persistence layer, rather than storing complete session snapshots. This extraction approach significantly reduces storage requirements while maintaining the ability to restore complete session state by combining the base snapshot with accumulated deltas.
Solution Approach 2:
Session data updates are segmented into individual change events (deltas) that are stored separately. Each delta represents a discrete modification to the session state, allowing efficient storage and incremental reconstruction of the complete session data without redundant information.
3Stability of the object's composition
If session data is synchronized synchronously across server nodes, then data consistency is improved, but system performance deteriorates due to blocking operations
Solution Approach 1:
Session data persistence operations are decoupled from the main request processing flow, allowing both operations to proceed continuously without blocking each other. The persistence layer operates independently, accepting and processing snapshot writes asynchronously while server nodes continue handling requests without waiting for persistence confirmation.
Solution Approach 2:
The persistence layer acts as an asynchronous intermediary that buffers and processes session data writes independently from request handling. This mediation allows the system to maintain data consistency without creating blocking dependencies between request processing and persistence operations.
4Reliability
If all session attributes are persisted, then data completeness is improved, but storage efficiency and access performance deteriorate
Solution Approach 1:
Only changed session attributes (deltas) are extracted and persisted, rather than storing complete session data or all attributes. This selective extraction approach maintains data completeness for changed attributes while significantly improving storage efficiency and access performance by reducing the amount of data that must be read and written.
Data Source
AI summary
A method, a system, and computer program product for session based data persistency are described. A request to execute, by an executing computing server, a service of an application during a terminal service session initiated by an initiating computing server is received. Current session data including a session header and session attributes is captured. A difference between the current snapshot of the session data and a past snapshot of the session data, generated by the initiating computing server and stored by a persistence layer, is determined. The session attributes stored by the persistence layer are updated based on the difference between the current snapshot of the session data and the past snapshot of the session data to enable execution of the service of the application without requesting reauthentication.


