Blockchain KV Storage Version Segmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The existing Key Value (KV) storage systems in blockchain networks face performance issues due to frequent index changes and resource overhead during data processing, particularly when handling block generation and bifurcations, leading to inefficient data storage and retrieval.
Innovation Solution
A data processing method that involves determining a current version identifier and using it to manage target key-value pairs, allowing for efficient writing, reading, and updating of data by retaining existing key-value pairs and using newly generated pairs for operations, thereby optimizing storage and reducing resource overhead during block rollbacks and redos.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If the KV storage system uses traditional indexing methods to store blockchain data, then data can be accessed and modified, but the index changes frequently with varied KV leading to excessive resource overhead and poor performance
Solution Approach 1:
The patent segments the key field into two independent parts: a persistent key identifier and a version identifier. This segmentation allows the key identifier to remain stable for indexing purposes while the version identifier captures changes, eliminating the need to rebuild indexes frequently and reducing resource overhead during blockchain operations.
Solution Approach 2:
The patent performs preliminary actions by pre-establishing the dual-component key structure before blockchain operations occur. The key identifier is assigned once and remains constant, while version identifiers are incrementally added, allowing the system to prepare for frequent updates without incurring repeated indexing costs.
2Reliability
If the KV storage system maintains traditional keys during block rollbacks and redos, then data can be restored to bifurcations, but extensive data recovery and index adjustment are required leading to excessive resource overhead
Solution Approach 1:
By segmenting the key into key identifier and version identifier components, the patent enables selective restoration during rollbacks. The persistent key identifier allows quick location of data, while the version identifier can be adjusted to restore previous states without requiring extensive data recovery or index rebuilding operations.
Solution Approach 2:
The patent discards the traditional single key structure in favor of a dual-component key system. This allows the system to recover only the necessary version information during rollbacks rather than recovering entire data structures and indexes, significantly reducing resource overhead during blockchain bifurcation events.
3Adaptability or versatility
If the KV storage system uses frequent index adjustments to accommodate KV changes, then data can be accessed according to business requirements, but the performance of the storage system deteriorates
Solution Approach 1:
The patent segments the key structure to separate the stable key identifier from the dynamic version identifier. This allows the indexing system to operate on the stable key identifier alone, maintaining high performance while the version identifier provides the necessary adaptability for different data access patterns and business requirements.
Solution Approach 2:
The dual-component key structure serves multiple functions simultaneously: the key identifier provides stable indexing, the version identifier enables version control and rollback capabilities, and together they support various data access patterns. This multi-functionality eliminates the need for separate indexing structures for different access requirements, improving overall system performance.
Data Source
AI summary
A data processing method is applied to a computing device serving as a blockchain node. The method comprises: acquiring a data processing request; according to the data processing request, determining a current version identifier; according to the data processing request, determining a target key value pair used for processing data, and processing data in the value range of the target value pair; writing a newly produced target value pair into a storage space, wherein the key domain of a key value pair in the storage area stores a key identifier and a version identifier, and the version identifier in the key domain of the newly produced target key value pair is the current version identifier.


