LiteGoDB is a lightweight key-value database written in Go, featuring a B-Tree storage engine, write-ahead logging (WAL), SQL-like command support, and a REST/WebSocket interface.
- B-Tree-based key-value storage engine
- Write-Ahead Logging (WAL) for durability and crash recovery
- SQL-like query support:
INSERT
,SELECT
,DELETE
- REST API and WebSocket interface
- Native Go client
- CLI client (
litegodbc
) - Docker-ready for local or containerized deployment
git clone https://github.com/rafaelmgr12/litegodb.git
cd litegodb
docker compose up --build
This will start the LiteGoDB server at http://localhost:8080
curl -X POST http://localhost:8080/sql \
-H "Content-Type: application/json" \
-d '{"query":"INSERT INTO users VALUES (1, '\''rafael'\'')"}'
curl -X POST http://localhost:8080/sql \
-H "Content-Type: application/json" \
-d '{"query":"SELECT * FROM users WHERE `key` = 1"}'
import "github.com/rafaelmgr12/litegodb/pkg/litegodb"
db, _ := litegodb.Open("config.yaml")
db.Put("users", 1, "rafael")
value, found, _ := db.Get("users", 1)
Run all unit and integration tests:
go test ./...
The CLI client connects to a LiteGoDB server via HTTP.
go run cmd/litegodbc/main.go --url http://localhost:8080
> INSERT INTO users VALUES (1, 'joao');
> SELECT * FROM users WHERE `key` = 1;
litegodb/
├── cmd/
│ ├── server/ # REST/WebSocket server entrypoint
│ └── litegodbc/ # CLI client
├── internal/
│ └── storage/ # B-Tree engine, disk manager, WAL
├── pkg/
│ └── litegodb/ # Public Go API interface
├── config.yaml # Server configuration
├── Dockerfile # Container build config
└── docker-compose.yml # Local dev environment
Contributions are welcome! Feel free to fork the repository, submit issues, or open pull requests.
MIT License — see the LICENSE file for details.