ecs-object-client-java icon indicating copy to clipboard operation
ecs-object-client-java copied to clipboard

Add a virtual node to vdc hashmap for consistent hashing

Open marrotte opened this issue 7 years ago • 0 comments

Currently, the geoppinning algorithm is fixed on the number of vdc, hence mod #vdc. This makes scaling harder and harder as the number of vdc increase. By implementing consistent hash, hence an intermediary hashmap, mapping virtual nodes to vdc, the impact from scaling can be minimized, much more manageable and provide much more flexibility. For example, for a 3-site vdc we can start with 4096 vnodes indexed uniformly with vdc numbers 0-2. The geopinning algorithm would fix it's mod operation on 4096 vs 3. As we scale up and add more vdc, we simply adjust our vnode to vdc hashmap as desired -- that is, most likely preserving uniformity and minimizing data migration, but not necessarily. This can even be made backward compatible with existing geopin code/deployments by configuring the hashmap appropriately, e.g. {0-4095}%4096 to {0-4095}%3.

marrotte avatar Feb 25 '17 22:02 marrotte