ShardedKV

An interface to sharded key-value stores
Download

ShardedKV Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Steffen Muller
  • Publisher web site:
  • http://search.cpan.org/~smueller/

ShardedKV Tags


ShardedKV Description

ShardedKV is a Perl module that implements an abstract interface to a sharded key-value store. The storage backends as well as the "continuum" are pluggable. "Continuum" is to mean "the logic that decides in which shard a particular key lives". Typically, people use consistent hashing for this purpose and very commonly the choice is to use ketama specifically. See below for references.Beside the abstract querying interface, this module also implements logic to add one or more servers to the continuum and use passive key migration to extend capacity without downtime. Do make it a point to understand the logic before using it. More on that below.SYNOPSIS use ShardedKV; use ShardedKV::Continuum::Ketama; use ShardedKV::Storage::Redis; my $continuum_spec = , # shard name, weight , ]; my $continuum = ShardedKV::Continuum::Ketama->new(from => $continuum_spec); # Redis storage chosen here, but can also be "Memory" or "MySQL". # "Memory" is for testing. Mixing storages likely has weird side effects. my %storages = ( shard1 => ShardedKV::Storage::Redis->new( redis_master_str => 'redisserver:6379', redis_slave_strs => , ), shard2 => ShardedKV::Storage::Redis->new( redis_master_str => 'redisserver:6380', redis_slave_strs => , ), ); my $skv = ShardedKV->new( storages => \%storages, continuum => $continuum, ); my $value = $skv->get($key); $skv->set($key, $value); $skv->delete($key);Product's homepage


ShardedKV Related Software