0.1.8 • Published 9 years ago

sharding v0.1.8

Weekly downloads
11
License
ISC
Repository
-
Last release
9 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

9 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago