Web Application State Management in Micro-Service Architectures
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Traditional web application state management in micro-service architectures faces challenges such as complex URLs, URL length limitations, increased computing power and memory requirements, and potential state loss due to HTTP cookie deletions, leading to inefficient and user-unfriendly state handling.
Innovation Solution
A computer-implemented method and system that utilizes a client-side state client with a client state store and a server-side micro-service to manage web application state, allowing state changes to be stored and transmitted between client and server, with a server-side state micro-service handling state persistence and notification, enabling flexible and scalable state management independent of user sessions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If web application state is represented in URLs, then state persistence across user sessions is achieved, but URL complexity increases and URL length limitations are reached
Solution Approach 1:
The patent extracts state information from URLs and stores it separately in a server-side database. The URL only contains a state identifier (ID) that references the actual state data, which is stored in the database. This separation eliminates the complexity and length issues of encoding entire state objects in URLs while maintaining the ability to persist and retrieve state across sessions.
Solution Approach 2:
The patent introduces a state management service as an intermediary between the web application and state storage. This service handles state persistence, retrieval, and management operations, decoupling the application logic from the actual state storage mechanism. The service can store state in various backends (database, cache, file system) without affecting the application code.
2Loss of information
If complete state is represented in URLs, then state information is available, but computing power and memory requirements increase
Solution Approach 1:
The patent extracts only the essential state identifier from the complete state object and stores it in the URL, while the full state data is stored in a server-side database. This dramatically reduces the amount of data that needs to be transmitted, stored in memory, and processed, while still providing access to the complete state information through the database.
Solution Approach 2:
The patent moves state storage from the URL dimension (client-side, limited capacity) to the database dimension (server-side, scalable capacity). This dimensional shift allows state data to be stored externally with much higher capacity and durability, reducing the burden on application memory and processing resources.
3Ease of operation
If state is managed by web application servers, then state control is maintained, but system complexity and resource requirements increase
Solution Approach 1:
The patent introduces a dedicated state management service as an intermediary layer between the web application and state storage. This service encapsulates all state management logic, providing a simplified interface to applications while handling the complexity of persistence, retrieval, validation, and state lifecycle management internally.
Solution Approach 2:
The state management service provides self-service capabilities for state operations, automatically handling state persistence, retrieval, and management without requiring complex application-level implementation. The service can be configured with different storage backends and management strategies without affecting application code.
4Loss of information
If state URLs are used for sharing, then state can be transmitted to other users, but URL length limitations and browser restrictions apply
Solution Approach 1:
The patent extracts only a compact state identifier from the complete state data and places it in the URL. This identifier is sufficient to retrieve the full state from the server-side database. The URL becomes short and shareable, while the complete state data remains in the database with no transmission size limitations.
Data Source
AI summary
A method for controlling a web application state in a micro-service architecture may be provided. The method loading a current state of the web application via a server-side state micro-service from a server state store upon a navigation to a website relating to a server-side micro-service of the web application. The method also comprises triggering a state change of the web application by a user interface control of the client user interface component, transmitting the changed state from the server-side micro-service of the web application to the server-side state micro-service, managing the changed state by the server-side state micro-service together with a state identifier in a server state store, transmitting the changed state and the state identifier from the server-side state micro-service to the state client, and notifying the client user interface component about the changed state.


