A simple persistent key-value database implemented in Go.
Offers a simple Write-Ahead-Logging (WAL) implementation that allows data restore across session.
Blog: https://kakku.org/writing-a-simple-database/
-
Make sure you have protocolbuffer installed
- https://grpc.io/docs/protoc-installation/
- Verify
protoc --help
-
Make sure Go 1.17.x is installed
- https://golang.org/dl/
- Verify
go version
-
Make sure you have Go installed and $GOPATH set
- Check
echo $GOPATH
returns a valid path
- Check
-
Clone repository
git clone https://github.com/amitt001/moodb.git
-
cd moodb
- Run build:
make build
- Run server:
go run cmd/server/main.go -logtostderr=true
- Open a new terminal window and run client:
go run mdbcli/*.go
In the client shell
MooDB version 0.0.1
o> set name Amit
Inserted 1
o> get name
Amit
o> del name
Deleted 1
o> get name
To just install write-ahead log Wal module can be used separately.
go get "github.com/amitt001/moodb/wal"