Movatterモバイル変換


[0]ホーム

URL:


You don’t need a vector database - just use Postgres for everything. Read the case study on switching from Pinecone to Neon
Docs
Docs
Neon DocsAsk Neon AI
/Features/Branching/About branching

Branching

Branch your data the same way you branch your code

With Neon, you can quickly and cost-effectively branch your data for development, testing, and various other purposes, enabling you to improve developer productivity and optimize continuous integration and delivery (CI/CD) pipelines.

You can also rewind your data or create branches from the past to recover from mistakes or analyze historical states.

What is a branch?

A branch is a copy-on-write clone of your data. You can create a branch from a current or past state. For example, you can create a branch that includes all data up to the current time or an earlier time.

working with sensitive data?

Neon also supports schema-only branching.Learn more.

A branch is isolated from its originating data, so you are free to play around with it, modify it, or delete it when it's no longer needed. Changes to a branch are independent. A branch and its parent can share the same data but diverge at the point of branch creation. Writes to a branch are saved as a delta.

Creating a branch does not increase load on the parent branch or affect it in any way, which means you can create a branch without impacting the performance of your production database.

Each Neon project is created with aroot branch calledmain. The first branch that you create is branched from the project's root branch. Subsequent branches can be branched from the root branch or from a previously created branch.

Branching workflows

You can use Neon's branching feature in variety workflows.

Development

You can create a branch of your production database that developers are free to play with and modify. By default, branches are created with all of the data that existed in the parent branch, eliminating the setup time required to deploy and maintain a development database.

development environment branch

The following video demonstrates creating a branch in the Neon Console. For step-by-step instructions, seeCreate a branch.

You can integrate branching into your development workflows and toolchains using the Neon CLI, API, or GitHub Actions. If you use Vercel, you can use the NeonPostgres Previews Integration to create a branch for each preview deployment.

Refer to the following guides for instructions:

Testing

Testers can create branches for testing schema changes, validating new queries, or testing potentially destructive queries before deploying them to production. A branch is isolated from its parent branch but has all of the parent branch's data up to the point of branch creation, which eliminates the effort involved in hydrating a database. Tests can also run on separate branches in parallel, with each branch having dedicated compute resources.

test environment branches

Refer to the following guide for instructions.

Restore and recover data

If you lose data due to an unintended deletion or some other event, you can restore a branch to any point in its restore window to recover lost data. You can also create a new restore branch for historical analysis or any other reason.

Recover from data loss using restore branching

Restore window

Yourrestore window determines how far back Neon maintains a history of changes for each branch. By default, this is set to1 day to help you avoid unexpected storage costs. You can increase it up to:

You can configure your restore window in the Neon Console underSettings >Storage >Instant restore. SeeConfigure restore window.

note

Increasing your restore window affectsall branches in your project and increasesproject storage. You can reduce it to zero to minimize cost.

History is retained in the form of Write-Ahead-Log (WAL) records. As WAL records age out of the retention period, they are evicted from storage and no longer count toward project storage.

Learn how to use these data recovery features:

Last updated on

Was this page helpful?
Thank you for your feedback!

[8]ページ先頭

©2009-2025 Movatter.jp