Lightweight Enqueue Session Management for Stateless Scalability
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Stateless business applications face challenges in managing exclusive locks across interaction steps due to the limitations of stateless programming models, which restrict scalability and lead to potential data inconsistencies and user dissatisfaction.
Innovation Solution
Implementing a light-weight enqueue session management system that decouples lock lifecycle from the application server, using WebSocket connections or timeouts, or a hybrid approach to manage enqueue locks independently, allowing locks to be maintained across interaction steps without the need for heavy-weight session objects.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If stateless programming paradigm is used to eliminate heavy-weight application states, then scalability is improved, but the ability to hold exclusive locks across multiple interaction steps deteriorates
Solution Approach 1:
The system segments the lock management functionality from the application server by introducing a separate enqueue server. The application server handles stateless request processing while the enqueue server independently manages lock lifecycle, allowing locks to persist across multiple interaction steps without requiring stateful application servers.
Solution Approach 2:
The enqueue server acts as an intermediary between the application server and the locking mechanism. It receives lock requests from the stateless application server, manages the lock lifecycle independently, and returns lock status information, thereby enabling lock management without requiring heavy-weight session objects on the application server.
2Ease of operation
If traditional ABAP session-based locking is used, then lock management is simplified, but resource consumption and system complexity increase
Solution Approach 1:
The lock management functionality is extracted from the ABAP session objects and placed in a separate enqueue server. This extraction eliminates the dependency between session objects and lock management, allowing locks to be managed independently without requiring heavy-weight session objects to be stored on the application server.
Solution Approach 2:
The system uses lightweight enqueue session identifiers that reference locks on the enqueue server, rather than maintaining full session objects. This copying approach allows the application server to work with simple identifiers while the actual lock management is handled by the enqueue server, reducing memory consumption and system complexity.
3Extent of automation
If locks are tied to ABAP sessions, then lock lifecycle management is automated, but stateless application compatibility is reduced
Solution Approach 1:
The system dynamically adapts to different application types by providing a unified enqueue session interface. For stateless applications, locks are managed through the enqueue server with automatic lifecycle management via timeouts or WebSocket connections. For stateful applications, the same interface works with traditional session-based locking, making the system versatile across different programming paradigms.
Solution Approach 2:
The enqueue server provides a universal lock management interface that works with both stateless and stateful applications. It handles lock requests from any application type, managing lock lifecycle automatically through configurable mechanisms (timeouts for stateless, session-based for stateful), thereby achieving both automation and versatility.
4Ease of operation
If heavy-weight session objects are stored on application server, then lock state management is simplified, but scalability and resource efficiency deteriorate
Solution Approach 1:
The system replaces heavy-weight persistent session objects with lightweight, short-lived enqueue session identifiers. These identifiers are inexpensive to create and store, and can be discarded after use. The actual lock state is maintained on the enqueue server, not on the application server, reducing memory consumption and improving resource efficiency while maintaining simplified lock state management.
Data Source
AI summary
In an example embodiment, a request for an enqueue lock for a first piece of data is received from a client application. At an enqueue server separate from an application server instance, a light-weight enqueue session is then created, including generating a light-weight enqueue session identification for the light-weight enqueue session. An enqueue lock for the first piece of data is stored in the light-weight enqueue session. The light-weight enqueue session identification is then sent to the client application. In response to a detection that a session between the client application and the application server instance has been terminated, all enqueue locks in the light-weight enqueue session are deleted and the light-weight enqueue session is deleted.


