#goDB
###Features
- Eventually Consistent
- Available
- Partition Tolerant
========
###Supported Operations
- Get
- Put
- Delete
========
###Mechnisms
#####Raft Leader Election for Consensus
Makes use of Raft Leader election protocol to achieve consensus. The system ensures that there is only one leader at a given point of time. It is fault tolerant. In the event of shutdown of the leader, a new leader is immediately elected. The system has been tested rigorously to maintain this property.
#####Raft Log Replication for Consistency
Consistency is achieved by using log replication. Every operation is declared to be committed only if it is committed in the log of majority of the servers. It it fails to do so then the operation is cancelled.
It makes use of leveldb to store the log entries
========
###Instructions for installing
#####Set GOPATH
> export GOPATH=<directory>
> export PATH=$PATH:$GOPATH/bin
> go get github.com/nikolodien/goDB
#####The next step can be skipped if you don't get any messages
> go build github.com/nikolodien/goDB
> go install $GOPATH/src/github.com/nikolodien/goDB/broker.go
========
###Usage
A new instance of the server has to be created using the statemachine.New()
function
After that, the client needs to connect to the server as follows
client, err := rpc.DialHTTP("tcp", host:port)
Each operation is an rpc call to the server
- Get
var val statemachine.Val
var key = "key_string"
err = client.Call("KVStore.Get", key, &val)
- Put
keyValue := statemachine.KeyValue{key, i}
var reply int
err = client.Call("KVStore.Put", keyValue, &reply)
- Delete
var reply int
key := "key_string"
err = client.Call("KVStore.Del", key, &reply)
========