Stateless Application Framework for Distributed Workflow State Management
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Stateless applications in distributed environments face inefficiencies due to the need for storing state and context data, which increases resource usage and can lead to inconsistencies when handling long-running tasks across multiple instances.
Innovation Solution
A stateless application framework that utilizes a stateless application module, a context database, and a messaging queue to manage state data persistently and ensure consistency through versioning, allowing instances to be terminated without losing state information and ensuring that tasks are performed based on the current state.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If state machines are used to keep track of states and contexts across different sessions, then session state management is achieved, but computer resources (memory and processing) increase significantly
Solution Approach 1:
The patent extracts the state storage function from the application instance memory and places it in an external database. The state machine logic remains in the application, but the actual state data is stored externally, allowing the application to be stateless regarding persistent data while maintaining full state management capability.
Solution Approach 2:
The patent introduces a database as an intermediary between the application instance and the state data. The database acts as a mediator that stores and retrieves state information, allowing multiple application instances to access and update state data without requiring the state to reside in memory of any single instance.
2Speed
If state data is kept in memory during idle sessions, then quick access is enabled, but resource efficiency decreases
Solution Approach 1:
The patent implements periodic or on-demand retrieval of state data from the database rather than continuously holding it in memory. Application instances retrieve state data only when needed for processing, and can be terminated when idle, with the state safely persisted in the database for future retrieval.
3Productivity
If multiple instances are used to handle increased requests, then processing capacity increases, but state consistency becomes difficult to maintain
Solution Approach 1:
The patent segments the state management function into two independent parts: the state machine logic (which processes events and determines state transitions) and the actual state data (which is stored in the database). This allows multiple application instances to independently execute state machine logic while all instances read and write to the same centralized database, ensuring consistency across the distributed system.
4Adaptability or versatility
If external data processing components are used in the workflow, then processing flexibility increases, but session completion time extends
Solution Approach 1:
The patent prepares and persists the complete state context in the database before external processing begins. When external data processing components are invoked, the application can retrieve the pre-prepared state from the database, process data asynchronously, and later resume or complete the workflow by retrieving the persisted state, rather than requiring the application instance to remain active throughout the entire external processing duration.
Data Source
AI summary
Methods and systems for providing a stateless application framework are presented. The stateless application framework is utilized by different applications for implementing different workflows. Each workflow may be associated with one or more state machine configurations representing the different states within the workflow. Upon receiving an indication of an event from an application, a stateless application module transmits a job request to a data processing engine based on a current state of the event. When a response is received from the data processing engine, the state application module determines whether the state of the event has been updated since transmitting the job request. If it is determined that the state has been updated, the stateless application module is configured to transmit another job request to the data processing engine based on the updated state of the event.


