Skip to content

Repository files navigation

tendb

The self-hosted Neon alternative — database branching for Postgres, on infrastructure you own.
Copy-on-write branches of your real database — AWS, GCP, Azure, or your laptop's Docker — ready in seconds.

npm version CI MIT license

Documentation · Quickstart · Example app

The tendb console: branches, storage, sync state, and platform settings on one dashboard

The bundled console (tendb console) — branches, SQL editor, snapshots, and alerts on localhost.

Try it in five minutes (no cloud account)

Prereqs: Node ≥ 20, Terraform ≥ 1.11, and Docker (macOS: also Homebrew — the preflight builds a small colima VM, since Docker Desktop's kernel has no ZFS; Linux runs it natively).

npm install -g @10play/tendb

tendb init --platform local    # scaffold terraform + tendb.json into your project
tendb up                       # ZFS/Docker preflight + terraform apply + config wiring
tendb branches create my-feature   # copy-on-write branch DB, ready in ~5s
tendb psql my-feature              # poke around; production never notices

The same flow takes you to production: tendb init --platform aws points at your own cloud account instead — see the AWS quickstart, or the GCP and Azure platform guides.

How it works

One host — an EC2 instance, a cloud VM, or Docker containers on your laptop — runs DBLab Engine on ZFS. It syncs from your source Postgres (Neon, Aurora, RDS, anything with a URL) and serves copy-on-write clones: every branch is a real, writable Postgres that costs only the disk pages you change and appears in seconds, at any database size.

  • tendb branches create my-feature — a disposable, writable copy of production-shaped data.
  • tendb ci ensure "$PR" | tail -1 — a preview database per pull request, one line of CI.
  • tendb migrate --scratch -- npm run migrate — rehearse a migration on an ephemeral branch that cleans up after itself; the real data is untouched.
  • tendb console — a Neon-style dashboard (branches, SQL editor, snapshots, alerts) on localhost.

Your data never leaves your infrastructure: no SaaS, no control plane, no third party. The CLI reaches the host over each platform's native tunnel (SSM on AWS, IAP on GCP, Bastion on Azure, loopback locally) — no SSH, no open database ports.

Repository

A pnpm monorepo; the product lives in packages/tendb/:

Path What it is
packages/tendb/terraform/ Per-platform engine/network/console modules behind one engine contract
packages/tendb/cli/ The @10play/tendb CLI + bundled web console
packages/tendb/snapshotd/ The on-host snapshot/schema executor
apps/docs/ The documentation site (live)
apps/example/ A runnable local-platform example: scaffold, branch, migrate, query

Developing locally: pnpm install, then pnpm docs:dev for the docs site and pnpm --filter @10play/tendb test for the CLI. See packages/tendb/README.md for architecture, sizing, and the CI contract.

Acknowledgements

tendb is built on DBLab Engine (Database Lab Engine) by Postgres.ai — the open-source engine that does the heavy lifting: ZFS thin cloning and copy-on-write branch databases. tendb adds the platform packaging around it (Terraform provisioning for AWS/GCP/Azure/local, tunnel transports, the CLI, the web console, and the CI contract).

License

MIT

About

The self-hosted Neon alternative — database branching for Postgres on infrastructure you own (AWS, GCP, Azure, or local Docker). Built on DBLab Engine.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages