A Naive attempt to implement Consensus using Raft on a in-memory key-value pair distributed database.
go run cmd/kvdbserver/main.go -id node1 -address :8000 -peers :8002,:8003
go test ./...
- Write unit test for all internal modules
- Write data to disk(lowpriority)
- Concurrent read/write, test with multiple clients etc..
- Update readme
- API client
- check for compatibility with 32bit systems(data types etc.)
kvdb/
├── cmd/
│ └── kvdbserver/
│ └── main.go
├── internal/
│ ├── storage/
│ │ └── storage.go
│ ├── replication/
│ │ └── replication.go
│ ├── partitioning/
│ │ └── partitioning.go
│ ├── consensus/
│ │ └── raft.go
│ ├── loadbalancer/
│ │ └── loadbalancer.go
│ └── node/
│ └── node.go
├── pkg/
│ └── client/
│ └── client.go
└── go.mod
- Raft Consensus Algorithm for quick understanding go to
Page no. 4
- Raft Visualization