Skip to content

Latest commit

 

History

History
62 lines (48 loc) · 1.5 KB

README.md

File metadata and controls

62 lines (48 loc) · 1.5 KB

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