0.1.8 • Published 8 years ago

sharding v0.1.8

Weekly downloads
11
License
ISC
Repository
-
Last release
8 years ago

Sharding

Usage

$ npm install --save sharding
var sharding = require('sharding');

var nodes = ['shard1', 'shard2', 'shard3'];
var s = new sharding.Sharding(nodes);
console.log('shard for user1 is [' + s.shard('user1') + ']');

// use sharding option

var option = {vnode_num: 500, seed: 20150503};
s = new sharding.Sharding(nodes, option);
console.log('shard for user1 is [' + s.shard('user1') + ']');

Parameters

  • default hash seed: 19861225
  • default virtual nodes number: 100
  • default hash algorithm: murmur2 64bit

If your other service want to use the same sharding strategy, the parameters above MUST be the same

0.1.8

8 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago