Soft Lock Mechanism for Stateless Microservice State Data Consistency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Cloud native architecture (CNA) networks face challenges in maintaining network consistency and avoiding conflicts between stateful and stateless network functions, particularly in 3GPP networks, where simultaneous transactions can lead to inconsistent state data and unpredictable behavior due to the statelessness of CNA.
Innovation Solution
Implementing a soft lock mechanism in an external database that allows only one microservice instance to access and modify state data, ensuring data integrity and consistency by deferring transactions to the instance holding the lock, while maintaining the stateless nature of microservices.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a hard lock mechanism is used in the database to ensure data consistency, then network reliability is improved, but system complexity and performance degradation increase due to transaction blocking
Solution Approach 1:
The patent introduces a lock indicator field in the database record as an intermediary mechanism. Instead of implementing complex hard lock logic in the database layer, the lock indicator serves as a simple binary flag that coordinates access between microservice instances. This intermediary approach maintains reliability by preventing concurrent modifications while avoiding the complexity of traditional database locking mechanisms.
Solution Approach 2:
The microservice instances perform their own locking and unlocking operations by directly modifying the lock indicator field in the database. Each instance checks the lock indicator before accessing state data and sets it when acquiring the lock. This self-service approach eliminates the need for a centralized locking service, reducing system complexity while maintaining data consistency.
2Reliability
If stateful network functions are implemented to maintain procedure consistency, then network continuity is improved, but scalability and flexibility deteriorate due to state retention requirements
Solution Approach 1:
The patent segments the state management functionality by separating the lock indicator field from the actual state data in the database. This segmentation allows the database to remain stateless regarding procedure state, while the lock indicator provides the necessary coordination for stateful operations. Microservice instances can be freely created and destroyed without retaining procedure state, maintaining scalability while ensuring network continuity through coordinated access control.
3Productivity
If multiple microservice instances access the same state data simultaneously, then processing speed is improved, but data consistency deteriorates due to concurrent transactions
Solution Approach 1:
The patent implements preliminary action by requiring microservice instances to check and set the lock indicator field before accessing or modifying state data. This preliminary locking action prevents concurrent transactions from proceeding simultaneously, ensuring data consistency is maintained while allowing rapid sequential processing. The lock indicator is set in advance before any state data operations occur, preventing race conditions.
Data Source
AI summary
A network function is implemented using cloud native architecture. The network function utilizes one or more loosely coupled and independently deployable microservice instances to perform services. To retain state between independent transactions, a microservice instance takes a soft lock on state data in an external database. The soft lock makes the state data unavailable except to the microservice instance. After the microservice instance completes the transaction, the microservice instance clears the lock so that the state data is available for use by other microservices.


