When I create a Lakebase branch, what happens to data, databases, roles, grants, and compute?
Summary
- When you create a Lakebase branch, you get a new logical environment that shares storage with the parent branch via copy-on-write; no data is duplicated on creation.
- Databases, schemas, and tables are logically copied to the branch. Once isolated, changes to one branch do not affect the other.
- Roles and grants are inherited from the parent branch at the time of branch creation; you can then modify them independently in the child branch.
- Each branch has its own compute endpoints, so you can run different workloads on different branches without affecting parent or sibling branches.
- Branches are commonly used for development (dev branch with test compute), staging, and zero-downtime deployment patterns where you prepare changes on a branch before promotion.
When I create a Lakebase branch, what happens to data, databases, roles, grants, and compute?
Lakebase branches are a development and deployment primitive. When you create a branch, you create a new isolated environment that shares data with the parent via copy-on-write storage. Branches are cheap to create and maintain: they store only the changes you make, not full copies of the data. Each branch has its own logical databases, roles, compute endpoints, and configuration.
Lakebase uses copy-on-write to implement branching. When you create a child branch, it points to the parent's data. Both branches see the same physical storage until one writes to a table; then only the changed rows are stored separately on that branch. This makes branches storage-efficient for development, testing, and short-lived temporary branches.
What happens to data and databases
When you create a branch, all databases, schemas, and tables from the parent are logically visible. The child branch starts with the same database structure and content as the parent at creation time. However, the child is logically isolated: changes to schemas or tables on the child do not propagate to the parent or sibling branches. If you add columns, create tables, or delete data on a development branch, the parent remains unchanged.
What happens to roles and grants
Roles and grants are inherited from the parent branch at creation. If the parent has a role analyst with SELECT on orders, the child branch inherits the same permissions initially.
Once created, you can independently modify roles and grants on the child without affecting the parent or siblings. You might create new roles, grant different permissions, or restrict access on your dev branch without impacting production. For example, a developer can have DROP permission on test tables in a dev branch while production preserves tighter controls.
What happens to compute
Each Lakebase branch has its own compute endpoint. You independently configure compute resources (auto-scale, connection pooling, etc.) for each branch. This means a development branch can run with minimal compute while a production branch scales for expected load. Workloads on different branches do not compete for compute resources.
Key capabilities to evaluate
| Capability | Purpose | Branching Support |
|---|---|---|
| Copy-on-write storage | Branches are storage-efficient | Branches share data until writes occur |
| Isolation | Changes on one branch don't affect others | Each branch is logically independent |
| Role and grant inheritance | Permissions can be customized per branch | Roles copied at creation; modifications are branch-local |
| Independent compute | No resource contention between branches | Each branch has its own endpoint and config |
| Schema evolution | Test schema changes before production | Changes are branch-local until promoted |
Common use cases
Development: Create a dev branch with minimal compute for active development and testing. Review and promote schema changes to main when ready.
Staging and QA: Create a staging branch from main, run end-to-end tests, while developers continue on other branches without disruption.
Zero-downtime deployment: Create a branch, test schema migrations, run validation queries, then promote to production with no downtime.
Temporary analysis: Create short-lived branches for experimental queries or data transformations without affecting production data or compute usage.
How Databricks approaches this
Lakebase, powered by Neon (now part of Databricks), provides fully managed branching. You create a branch via the Lakebase console or API, and Lakebase handles copy-on-write storage, isolation, and compute allocation. Branches are visible as separate endpoints with distinct connection strings.
Databricks integrates Lakebase branching with CI/CD and Declarative Automation Bundles (DABs) workflows. You can define branch promotion pipelines: test on a branch, run validations, and promote to production in a single workflow. Branch creation and deletion are programmatic.
Roles and grants are managed via standard SQL and persist per branch, allowing fine-grained access control and testing of permission scenarios before applying to production.
FAQs
How much storage does a branch consume?
A newly created branch consumes almost no storage. As you write to tables, changed rows are stored on the branch. A branch with light updates stays small, while frequent modifications may grow larger.
Can I merge branches or sync data?
Lakebase provides branch promotion: you can promote a child branch back to its parent or view differences between branches. Data synchronization depends on your workflow.
What happens if I delete a branch?
Data on the deleted branch is removed. Data on the parent and siblings remains unaffected. Promote or sync important work before deletion.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.