A Write-Ahead Log (WAL) based key-value database written in Go. It provides durability and atomicity for key-value operations using a simple and efficient design.
- Write-ahead logging for durability
- Simple key-value operations
- Batch operations support
- Database snapshots
- Health checks and repair utilities
- Design Document - Architecture and design decisions
git clone https://github.com/julianstephens/waldb.git
cd waldb
go build -o waldb ./cmd/waldbDownload pre-built binaries from the releases page.
# Initialize a new database
waldb init /path/to/db
# Store a key-value pair
waldb put mykey myvalue
# Retrieve a value
waldb get mykey
# Delete a key
waldb del mykey
# Show database statistics
waldb stats
# Check database health
waldb doctor
# Repair a database
waldb repair /path/to/dbFor detailed command help:
waldb --help
waldb <command> --help- Go 1.25 or later
- golangci-lint (for linting)
go build -o waldb ./cmd/waldbRun all tests:
go test ./...Run unit tests:
go test ./internal/waldb/... ./cmd/...Run E2E tests:
go test ./internal/tests/e2e/...Run tests with race detection:
go test -race ./...Run tests with coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.outFormat code:
golangci-lint fmtRun golangci-lint:
golangci-lint runA Makefile is provided for convenience:
make build # Build the binary
make test # Run tests
make lint # Run linters
make fmt # Format code
make clean # Clean build artifactswaldb/
├── cmd/
│ └── waldb/ # Main CLI application
├── internal/
│ ├── waldb/ # Core database implementation
│ ├── cli/ # Command handlers
│ ├── testutil/ # Test helpers and mocks
│ └── tests/e2e/ # End-To-End tests
├── docs/ # Documentation
├── .github/
│ └── workflows/ # CI/CD workflows
├── go.mod
├── go.sum
├── Makefile
├── LICENSE
└── README.md
MIT License - see LICENSE for details.