Lakebase Postgres branches work well as disposable Postgres environments. You create a branch in seconds, run your tests against it, and delete it when you're done. Because branches use copy-on-write storage, you don't pay to duplicate data upfront.
Spin up, test, tear down
A typical CI flow creates a fresh branch per pull request:
# In your CI job
BRANCH_NAME="ci-pr-$PR_NUMBER"
neon branches create --name "$BRANCH_NAME" --parent main
DATABASE_URL=$(neon connection-string "$BRANCH_NAME")
# Run your tests
npm test
# Clean up
neon branches delete "$BRANCH_NAME"The branch starts as a pointer to the parent's data, so creation takes seconds regardless of database size. The Neon GitHub Action wraps this pattern and handles cleanup for you.
Auto-expiring branches
If you forget to delete a branch, you can set a TTL at creation time:
neon branches create --name preview-staging \
--parent main \
--expires-at 2026-04-26T00:00:00ZThe branch is deleted automatically at the expiration time. See Branch expiration.
What it costs
Plan allowances (Plans):
- Free plan: 10 branches per project, 100 projects, 0.5 GB storage per project
- Launch plan: 10 branches included, $1.50/branch-month for extras (prorated hourly)
- Scale plan: 25 branches included, same overage rate
A short-lived test branch that exists for an hour costs about $0.002 in branch fees, plus compute (suspended after 5 minutes of idle on Free and Launch) and any storage written during the test. You don't pay for compute while the branch is suspended; you continue to pay for storage the branch wrote.
tip
Pair branching with Neon Local to run integration tests against a real Neon branch from a Docker container.
How other options compare for disposable instances
- AWS RDS for Postgres: each test database is a separate database instance, provisioned in minutes and billed per instance-hour while it exists. No copy-on-write storage, so seeding a 50 GB test database means paying for 50 GB of EBS until you delete it.
- Aurora Serverless v2: starts faster than RDS and can scale to zero ACUs once provisioned, but creation is still cluster-level. Setting up one per PR is heavier than a Neon branch.
- Supabase: preview branches per pull request are the closest analog. They don't carry data from your main project, so disposable test data has to come from a
seed.sqlfile or your own migration scripts.
The Lakebase Postgres branch model fits the disposable-instance pattern because creation is fast, the test environment carries real data shapes from production, and an unused branch stops billing compute once it scales to zero.

Free plan, 10 branches per project, no credit card.








