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.
- Replication and Quorum
- Redistribution of Shards on Node Join/Leave
- Membership List is maintained using SWIM Protocol
- Consistent Hashing for Shard Distribution
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"
RedistributionLoggingReplicationRemove HTTP Port Number Hack