Consistent Hashing for Uniform Server Load on Sequential User IDs
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current algorithms for mapping users to servers lack consistency and uniformity when servers are added or removed, leading to frequent remapping and inefficiency, especially for linear sequential user IDs.
Innovation Solution
A consistent hashing/uniformity algorithm that minimizes user remapping by redistributing users only when servers are added or removed at endpoints, maintaining a uniformity ratio and optimal distribution.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If modulo algorithm is used for mapping users to servers, then the algorithm runs extremely fast in O(1) and achieves perfect uniform distribution for linear sequential user IDs, but users are shuffled to other servers frequently when servers are added or removed, lacking consistent hashing
Solution Approach 1:
The patent transforms the one-dimensional modulo operation into a two-dimensional consistent hashing space. By organizing servers in a circular hash space and using hash functions to map user IDs to positions in this space, the system achieves both O(1) lookup speed and stable mappings. When servers are added or removed, only users in the affected hash space segments need remapping, not all users as in pure modulo algorithms.
Solution Approach 2:
The patent changes the hashing parameter from simple modulo arithmetic to consistent hashing functions that consider the entire server list configuration. The hash function takes into account the number of servers and their positions in the hash space, allowing the system to maintain uniform distribution while minimizing remapping when server count changes.
2Speed
If jump hash algorithm is used, then the algorithm runs very fast with O(Log(N)) complexity and achieves uniform distribution for random user IDs, but there is only approximate uniform distribution for linear sequential user IDs
Solution Approach 1:
The patent changes the hashing approach from jump hash's logarithmic complexity to a linear-time consistent hashing method that achieves perfect uniformity for sequential IDs. By using a hash function that distributes users uniformly across the hash space and handling server additions/removals through localized remapping, the system achieves both speed and perfect uniform distribution.
3Adaptability or versatility
If servers are added or removed from the system, then the system adapts to changing capacity, but users are randomly remapped to multiple servers causing unsteadiness and chaos in the system
Solution Approach 1:
The patent segments the user population into groups based on their hash space positions relative to server configurations. When a server is added or removed, only the segment of users affected by that change needs remapping, while other user segments maintain their original server assignments. This segmentation approach maintains system adaptability while preserving user distribution steadiness.
Solution Approach 2:
The patent introduces a consistent hashing function as an intermediary between user IDs and server assignments. This intermediary maintains a stable mapping relationship that only changes minimally when servers are added or removed, preventing random shuffling and maintaining system steadiness while still allowing adaptation to capacity changes.
4Adaptability or versatility
If current remapping algorithms are used, then servers can be dynamically added or removed, but the amount of user remapping is excessive and creates inefficiency in the system
Solution Approach 1:
The patent applies partial remapping instead of complete remapping when servers are added or removed. Only the subset of users affected by the server configuration change undergoes remapping, while the majority of users continue to be served by their original servers. This partial action approach maintains dynamic server configuration capability while significantly improving system efficiency by avoiding unnecessary remapping operations.
Data Source
AI summary
A computer-implemented method includes initializing, by a processor, users within a network to respective servers to perform one or more tasks or functions within the respective servers. The method also includes identifying, by the processor, if at least one of the users needs to be reassigned to a different server from the original server in which the at least one user was assigned. A determination is made if a new server is being added, or one of the original servers is being removed. Further, the method also includes assigning, by the processor, the at least one user to a different server from among the initialized respective server based on the determination to add the new server or remove one of the original servers.


