Database Shard Migration via Hash Wheel Distribution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
High traffic volumes in database systems can lead to delays and instability, particularly when serving a large number of users, causing frustration and data errors due to the need for continuous access to data records, which is challenging especially during maintenance operations or when transferring data between shards.
Innovation Solution
A control module that employs a hash wheel distribution mechanism to efficiently manage data transfers between shards by generating hash values and selecting ranges for data transfer, allowing for phased and controlled migration of data collections without locking users out, ensuring continuous access and minimizing data errors.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If data is transferred between shards to maintain database capacity and reliability, then database reliability is improved, but user access continuity deteriorates due to potential data locking and maintenance interruptions
Solution Approach 1:
The system performs preliminary hashing calculations to determine the destination shard for each data record before actual data transfer begins. This allows the system to pre-plan migration paths and minimize disruptions during the actual transfer process, ensuring user access continuity while maintaining database reliability.
Solution Approach 2:
The patent introduces a shard migration coordinator as an intermediary component that manages data transfer between shards. This coordinator handles the complexity of migration operations, coordinates with multiple shards simultaneously, and ensures that user requests are properly routed during migration, thus preventing access interruptions while enabling reliable data transfer.
2Quantity of substance
If database partitioning into shards is implemented to store large quantities of data, then storage capacity is improved, but system complexity increases due to data location management and transfer coordination
Solution Approach 1:
The hashing function used in the patent serves multiple functions simultaneously: it determines data location, calculates migration destinations, and provides a consistent method for both read and write operations. This universal approach simplifies the system architecture by eliminating the need for separate location management systems, thus reducing overall system complexity while maintaining high storage capacity.
3Productivity
If data transfer between shards is performed to offload capacity-constrained shards, then storage efficiency is improved, but data access time increases due to potential locking and maintenance operations
Solution Approach 1:
The system implements periodic migration operations where data is transferred in scheduled batches rather than all at once. This periodic approach allows normal user access to continue during most operations, with minimal disruptions during scheduled transfer windows, thus maintaining both storage efficiency and acceptable data access times.
Data Source
AI summary
A control module transferring data between a shard and destination shards within a database comprising a plurality of shards, the control module: generating a first hash wheel distribution of shard allocations by applying a defined hashing function to a first integer value per shard allocation; generating a further hash wheel distribution of shard allocations by applying the defined hashing function to a further integer value per shard allocation; determining a range of hash values associated with data to be transferred between the shard and a destination shard, wherein the range of hash values, the shard and the destination shard are defined based on determining a difference between the first hash wheel distribution of shard allocations and the further hash wheel distribution of shard allocations; selecting and controlling the transfer of data associated with the determined range of hash values between the shard and the destination shard.


