TOONDB is a lightweight document database engine with a production-ready HTTP service layer.
Repository:
It is designed for:
- single-tenant containerized DB instances
- SaaS multi-instance deployment patterns
- simple URL + username + password access from apps
- Document storage with schema validation
- Indexed equality lookups
- TOON + JSON support
- WAL-based durability and recovery
- Tenant-isolated storage layout
- Bridge-compatible action API
JavaScript SDK:
npm install toondbFrom this repository root:
docker compose up -d --buildDefault service endpoint:
http://localhost:6767
Default compose environment is in:
docker-compose.yml
Set these before production use:
TOONDB_USERNAMETOONDB_PASSWORDTOONDB_TENANT
$u = "replace_me_user"
$p = "replace_me_password"
$auth = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$u`:$p"))
curl -H "Authorization: Basic $auth" http://127.0.0.1:6767/healthIf using managed TOONDB cloud (toondb.io):
- Create a DB instance in the cloud dashboard.
- Copy instance URL, username, and password.
- Use the SDK or direct HTTP API.
SDK usage:
npm install toondbimport { ToonDBClient } from "toondb";
const client = new ToonDBClient({
baseUrl: "https://your-instance.toondb.io",
username: "your-user",
password: "your-pass",
});All endpoints require HTTP Basic Auth.
GET /healthPOST /v1/collections/{collection}/createPOST /v1/collections/{collection}/schema/updatePOST /v1/collections/{collection}/insertPOST /v1/collections/{collection}/findPOST /v1/collections/{collection}/updatePOST /v1/collections/{collection}/deleteGET /v1/collections/{collection}/dump
POST /v1/bridge
Supported bridge actions:
create_collectioninsertupdateupdate_schemafinddeletedumpshutdown
Environment variables:
TOONDB_HOST(default:0.0.0.0)TOONDB_PORT(default:6767)PORT(fallback for cloud platforms like Railway)TOONDB_DATA_DIR(default:./data-go)TOONDB_TENANT(default:default)TOONDB_USERNAME(optional; generated if empty)TOONDB_PASSWORD(optional; generated if empty)
If credentials are not provided, TOONDB auto-generates:
- username: 2 random lowercase words concatenated
- password: random 24-character secret
go run ./cmd/toondb-service -host 127.0.0.1 -port 6767 -tenant acme -data-dir ./data-go<dataDir>/tenants/<tenantId>/
collections.meta.json
<collection>.toon
<collection>.idx
<collection>.wal
With Docker, keep volume mapping enabled for persistence.
go test ./...Release and distribution guidance: