MVCC in-memory tree data structures for high concurrency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current caching systems, such as JBoss Cache, face challenges in maintaining data integrity and concurrency when multiple processes access the same data simultaneously, particularly due to issues with pessimistic and optimistic locking strategies that lead to poor concurrency, high memory overhead, and scalability limitations.
Innovation Solution
Implementing Multi Version Concurrency Control (MVCC) in a memory tree-based data structure using Java memory semantics, where readers access the original node directly and writers create a copy for modifications, ensuring only one writable copy exists, and using a LockManager to manage locks efficiently, allowing concurrent reads without blocking.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If pessimistic locking strategy is used to maintain data integrity, then data consistency is improved, but concurrency performance deteriorates due to readers being blocked during writes
Solution Approach 1:
The patent implements multi-version concurrency control where writers create copies of cache nodes for modification while readers access the original node. This copying mechanism allows readers and writers to operate on different versions simultaneously, eliminating blocking while maintaining data integrity through version management and commit protocols.
2Productivity
If optimistic locking strategy is used to improve concurrency, then concurrency performance is improved, but memory overhead increases due to maintaining multiple versions
Solution Approach 1:
The patent applies local quality by maintaining version information only where necessary - specifically in the CacheNode class structure where version fields are added. Readers access nodes with version metadata without duplicating entire data structures, and writers create copies only when modifications are needed. This selective versioning minimizes memory overhead while enabling optimistic concurrency control.
3Productivity
If multiple writable copies are maintained per node to allow concurrent writes, then write concurrency is improved, but device complexity increases due to managing multiple copies
Solution Approach 1:
The patent implements dynamic copy management where the number of writable copies is determined by actual write concurrency needs rather than being statically fixed. The LockManager dynamically allocates and manages copies based on transaction requirements, and copies are automatically cleaned up after commits. This dynamic approach allows flexible write concurrency while managing complexity through automated lifecycle management.
Data Source
AI summary
A method and apparatus for providing concurrent access to a cache node of a tree-based data structure. Readers concurrently read access the cache node. A copy of the cache node is created for a write access of a writer. Only one copy of the cache node is allowed at any one time. The writer operates on the copy of the cache node while concurrent read access of the cache node are provided to the readers.


