MIT • Open Source

Branch databases like code

Spin up fresh database instances instantly when you need them. Zero‑copy ZFS snapshots, deterministic seeding, and a simple CLI + HTTP API for any workflow.

Docker‑native. Self‑hosted. Works locally and in CI.

Perfect for any development workflow

🔧

PR Development & Review

Create isolated database branches for every pull request. Test changes safely without affecting other developers or shared environments.

  • Isolated per-PR environments
  • Clean data for every code review
  • CI/CD integration ready
🧪

Safe Experimentation

Try schema changes, test migrations, or prototype features without risking production data or breaking shared development databases.

  • Risk-free schema experiments
  • Migration testing
  • Instant rollback to clean state
🎯

Testing & QA

Generate consistent test datasets, run integration tests in isolation, or create demo environments with predictable data states.

  • Deterministic test data
  • Parallel test execution
  • Demo environment setup

Technical capabilities that make it work

Zero‑copy ZFS snapshots

Instant database cloning with no storage overhead. Create branches in milliseconds, not minutes.

Docker‑native architecture

Self‑contained deployment using standard containers. Works with your existing Docker infrastructure.

Multi‑database support

Postgres and MySQL compatibility. Bring your own images, seeds, and migration scripts.

Deterministic seeding

Reproducible data states across environments. Same seed scripts produce identical database content every time.

CLI and HTTP API

Script everything with predictable commands and JSON endpoints. Integrate with any workflow or CI system.

Complete isolation

Fully sandboxed database instances with independent networking and storage. No cross‑contamination between branches.

How it works

1

Connect

Point StagDB at your base database and seed scripts.

2

Snapshot

Create a zero‑copy ZFS snapshot from the base.

3

Branch

Spin up per‑PR clones with deterministic seeding.

4

Reset

Return to clean state anytime — instantly.

Simple, scriptable workflows

# Snapshot the base and create a feature branch
stagdb snapshot create \
  --db postgres://user:pass@localhost:5432/app \
  --name base

stagdb branch create \
  --from base \
  --name feature-123

# Seed with initial data
stagdb seed apply \
  --branch feature-123 \
  --seed seeds/init.sql

# Reset when done
stagdb reset --branch feature-123
Use the CLI locally or from CI.
# Create branch via HTTP API
curl -X POST https://api.stagdb.com/branches \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "from": "base",
    "name": "feature-123"
  }'

# Seed with a dataset
curl -X POST https://api.stagdb.com/seeds/apply \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "branch": "feature-123",
    "seed": "seeds/init.sql"
  }'
JSON API for automation and integrations.
🚀 MIT Licensed

Free & Open Source

Self‑host on your infra with full control. No lock‑in, no limits.

  • Unlimited branches
  • Zero‑copy ZFS snapshots
  • Postgres & MySQL support
  • Deterministic seeding
  • CLI + HTTP API
  • CI‑friendly by design
  • Self‑hosted
  • Community support
Read the docs
Join the community • GitHub Documentation