Skip to content

dsorchard/dist_kv

Repository files navigation

Dist KV

This is a tiny distributed key-value store implemented in Go. Majority of the code is based on MemberList and Consistent Library to simplify the implementation.

Features

  • Replication and Quorum
  • Redistribution of Shards on Node Join/Leave
  • Membership List is maintained using SWIM Protocol
  • Consistent Hashing for Shard Distribution

Run

go build
./dist_kv
./dist_kv -gossip=9000 -http=9001
./dist_kv -gossip=10000 -http=10001
curl -Ss -XPOST "http://localhost:9001/kv/1/alex"
curl -Ss -XPOST "http://localhost:9001/kv/2/benny"
curl -Ss -XPOST "http://localhost:9001/kv/3/cassie"
curl -Ss -XGET "http://localhost:8001/shards"
curl -Ss -XGET "http://localhost:9001/shards"
curl -Ss -XGET "http://localhost:10001/shards"
curl -Ss -XGET "http://localhost:8001/kv/1" 
curl -Ss -XGET "http://localhost:9001/kv/2" 
curl -Ss -XGET "http://localhost:10001/kv/3" 

TODO

  • Redistribution
  • Logging
  • Replication
  • Remove HTTP Port Number Hack

Reference

About

Simple Distributed KV Server using MemberList and Consistent

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages