Isolated development
Create a production-like environment where developers can run migrations or experiment without changing production.
Neon · Const
Neon branching creates isolated copy-on-write database branches from current or historical states. Child changes are stored independently, enabling safe development, testing, CI/CD, and recovery workflows.
Neon branching creates an isolated copy-on-write clone from a branch's current or historical state. The new branch initially shares its parent's data, while subsequent writes are stored independently as deltas, so experimenting on the child does not affect the parent or add load to it.
neon branches create --project-id <project-id> --name <branch-name>neon branches create --project-id "$NEON_PROJECT_ID" --name preview-123Creates an isolated database branch named preview-123 from the project's default branch.
Create a production-like environment where developers can run migrations or experiment without changing production.
Give each pull request or pipeline run its own database state for migrations and tests.
Start a branch from an earlier database state to investigate or recover from data loss.
A Neon branch is a copy-on-write clone of database data. It can be created from the current state or a past state, and changes made afterward are isolated to that branch.
Follow-up: Why is creating one suitable for production-like testing? The branch shares existing data rather than copying it up front, while writes become deltas and do not affect the parent.
The first branch is created from the project's root branch. Later branches may use either the root or an existing branch as their parent, allowing branch hierarchies.
Follow-up: What must be checked before branching from a child? Its inherited state and ancestry, because the resulting branch starts from that child's state rather than directly from the root.
Branching is useful for isolated development, testing, and CI/CD. A branch can contain production-like data while developers or automated pipelines modify it without changing production.
Follow-up: How can branching help recover data? Neon allows a branch to be created from a previous point within the available history window, enabling rollback-oriented recovery.
root branchparent branchNeon CLINeon APIGitHub Actions