Three-Way Merge Process for Database Contention Windows
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current database locking mechanisms, such as pessimistic and optimistic locking, lead to delays and poor user experiences due to excessive contention windows, especially in time-sensitive applications.
Innovation Solution
Implementing a three-way merge process that stores multiple copies of data, allowing updates to be made on a clone copy without locking the original, and then merging changes with the current data state upon commit, reducing the time a record is exclusively locked.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If pessimistic locking is used to prevent concurrent update conflicts, then data consistency is maintained, but user experience deteriorates due to delays and forced restarts
Solution Approach 1:
The system performs preliminary actions by creating a local copy of the data before the user begins editing. This allows the user to work with the copy without affecting the original data, and the lock is only applied briefly during the commit phase to resolve any conflicts. This preliminary copying action enables optimistic concurrency control while maintaining data consistency.
Solution Approach 2:
The patent introduces an intermediary mechanism (local copy/cache) between the user and the actual data. This intermediary allows users to perform operations without directly locking the source data, and conflicts are resolved through a three-way merge process that acts as a mediator between concurrent modifications. This intermediary approach maintains reliability while improving ease of operation.
2Ease of operation
If optimistic locking is used to reduce delays, then user experience improves, but data consistency deteriorates due to transaction rollbacks from concurrent updates
Solution Approach 1:
The system implements feedback through the three-way merge process during commit. When a user attempts to commit changes, the system retrieves the current state of the data, compares it with the user's local copy and the original version, and automatically resolves conflicts by applying both sets of changes. This feedback mechanism ensures data consistency is maintained while allowing optimistic locking to improve user experience during the editing phase.
Solution Approach 2:
The patent performs preliminary actions by maintaining local copies of data and preparing merge strategies before conflicts occur. The three-way merge is pre-configured to handle concurrent modifications, so when conflicts do arise, they can be resolved automatically without transaction rollbacks. This preliminary preparation maintains reliability while enabling optimistic locking benefits.
3Reliability
If locks are held for extended periods to ensure data consistency, then reliability improves, but productivity deteriorates due to reduced concurrency
Solution Approach 1:
The patent segments the locking process into two distinct phases: a read phase where no lock is held and users can freely access data, and a brief write phase during commit where a lock is applied only to perform the three-way merge. This segmentation allows data to remain unlocked for most of the time, maintaining high concurrency and productivity while ensuring consistency during the critical merge operation.
Solution Approach 2:
The system performs preliminary actions by creating and maintaining local copies of data before the commit phase. This allows the actual data to remain unlocked during user editing, and the lock is only applied briefly during commit to resolve conflicts. This preliminary copying enables high concurrency while maintaining reliability through controlled locking during the merge operation.
4Reliability
If frequent locks are applied to prevent conflicts, then data consistency is maintained, but loss of time increases due to lock acquisition and release overhead
Solution Approach 1:
The patent segments the operation into a long read phase without locking and a brief commit phase with locking. By segmenting when locks are applied, the system minimizes the total time locks are held, reducing lock overhead while maintaining data consistency through the three-way merge process during the brief locked period.
Solution Approach 2:
The system performs preliminary actions by preparing local copies and conflict resolution strategies before locks are needed. This allows the lock to be applied only for the minimal time required to execute the three-way merge, rather than being held throughout the entire editing process. This preliminary preparation significantly reduces lock overhead time while maintaining reliability.
Data Source
AI summary
Embodiments of the present invention provide improved concurrency by reducing the time period (also referred to herein as a locking window or contention window) during which a record is locked. This provides the benefits of pessimistic locking schemes by preventing transaction due to concurrent updates, while also reducing the time during which a record is exclusively locked. This improves user experience and performance.


