MVCC in-memory tree data structures for high concurrency

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvedata consistencyVSAvoidconcurrency performance
Core Design Contradiction:
ReliabilityVSProductivity

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.

Inventive Principle:
Principle #26Copying

2Productivity

If optimistic locking strategy is used to improve concurrency, then concurrency performance is improved, but memory overhead increases due to maintaining multiple versions

Engineering Contradiction:
Improveconcurrency performanceVSAvoidmemory overhead
Core Design Contradiction:
ProductivityVSQuantity of substance

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.

Inventive Principle:
Principle #3Local quality

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

Engineering Contradiction:
Improvewrite concurrencyVSAvoidcomplexity of managing copies
Core Design Contradiction:
ProductivityVSDevice complexity

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.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS7761434B2Multiversion concurrency control in in-memory tree-based data structures
Publication Date: 2010.07.20 RED HAT INC
  • US7761434B2 patent drawing
  • US7761434B2 patent drawing
  • US7761434B2 patent drawing

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.