Atomic Data Versioning for Cross-Storage Consistency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for keeping data consistent across different storage systems often lead to inconsistencies due to concurrent updates and read operations.
Innovation Solution
A method that processes data as unreadable via an atomic operation and updates the version number corresponding to a primary key, ensuring that data updates and version number updates are performed as a whole, thereby maintaining data consistency across storage systems.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If data is updated in storage system A first and then deleted in storage system B, then the latest data can be kept in storage system A, but data inconsistence occurs between the two storage systems
Solution Approach 1:
The patent merges the data update operation with the version number update operation into a single atomic operation. When data is updated in storage system A, both the data content and the version number are updated simultaneously, ensuring that storage system B cannot read stale version numbers while avoiding data inconsistencies between the two storage systems.
Solution Approach 2:
The patent performs preliminary action by updating the version number in storage system A before allowing storage system B to read or update its data. This preliminary version number update ensures that subsequent read operations in storage system B will detect the version change and trigger appropriate data synchronization, preventing data inconsistence.
2Ease of operation
If version number is updated separately from data update, then version tracking is simplified, but data inconsistence occurs during concurrent operations
Solution Approach 1:
The patent combines version number management with data update operations into a unified atomic process. The version number is not managed separately but is instead updated as an integral part of the data update operation in storage system A, ensuring consistency while maintaining version tracking capability.
Solution Approach 2:
The version number acts as an intermediary mechanism that mediates between storage system A and storage system B. By embedding the version number update within the atomic data update operation, it serves as a reliable signal for storage system B to detect changes and synchronize its data, ensuring consistency without complex separate management.
3Speed
If read operation checks storage system B first and then updates from storage system A, then read performance is improved, but data inconsistence may occur during concurrent updates
Solution Approach 1:
The patent implements feedback mechanism where storage system B reads the version number from storage system A before performing read operations. This feedback loop ensures that storage system B can detect any version changes that occurred during concurrent updates and trigger appropriate data synchronization, maintaining data consistency while preserving read performance optimization.
Solution Approach 2:
The patent performs preliminary version number verification in storage system B before executing read operations. By checking the version number in advance, storage system B can determine whether data synchronization is needed, ensuring data consistency is maintained while allowing fast reads when data is already up-to-date.
Data Source
AI summary
A method and apparatus for keeping data consistent across different storage systems are provided. The method includes: when a first storage system is updated, processing first data to be unreadable, and generating or updating a version number corresponding to a first primary key; when the first data is unable to be read from a second storage system, acquiring a latest version number of the first primary key, and reading second data from the first storage system; comparing the acquired version number with the latest version number of the first primary key; if consistent, updating the second data into the second storage system using an atomic operation, and updating the version number corresponding to the first primary key; and if inconsistent, re-performing the step of acquiring the latest version number of the first primary key and reading the second data from the first storage system.


