goDB

command module
v0.0.0-...-3d1c771 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

README

#goDB

###Features

  1. Eventually Consistent
  2. Available
  3. Partition Tolerant

========

###Supported Operations

  1. Get
  2. Put
  3. 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

  1. Get
    var val statemachine.Val
    var key = "key_string"
    err = client.Call("KVStore.Get", key, &val)
  2. Put
    keyValue := statemachine.KeyValue{key, i}
    var reply int
    err = client.Call("KVStore.Put", keyValue, &reply)
  3. Delete
    var reply int
    key := "key_string"
    err = client.Call("KVStore.Del", key, &reply)

========

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL