View a markdown version of this page

How database branches work - Amazon Aurora

How database branches work

A database branch combines copy-on-write storage with isolated serverless compute, and it inherits the parent cluster's connectivity and security settings. The following characteristics describe how branches work.

Concepts

Copy-on-write storage

A branch initially shares the parent cluster's data pages and stores only the data that changes on the branch. This makes a branch fast and space-efficient to create, because Aurora doesn't physically copy the parent cluster's data.

Serverless compute

Each branch runs on its own Aurora Serverless compute, which scales capacity up and down with demand and scales to zero when the branch is idle. You don't choose an instance type for a branch.

Dedicated endpoint

Each branch has its own read/write endpoint. The endpoint inherits the parent cluster's connectivity settings, such as its virtual private cloud (VPC) and security groups.

Inherited security

A branch inherits the parent cluster's security controls. These include encryption at rest and in transit, the parent's database users and roles, and Aurora dynamic data masking policies. For more information, see Using dynamic masking with Aurora PostgreSQL. As a result, developers and agents work within the access boundaries that administrators already defined on the parent cluster.

Automatic expiration

Each branch has a required time-to-live (TTL). When the TTL expires, Aurora automatically deletes the branch. This helps keep short-lived test environments from accumulating.

Branch-of-branch

You can create a branch from an existing branch, up to one child level.

Branches per cluster

For the number of branches per cluster and other limits, see Branch capabilities, limitations, and quotas.

Use cases

Database branches support the following common use cases.

AI-assisted development

AI agents and developers need isolated environments to experiment with schema changes and validate data transformations without risking production. When an agent generates backend code or a database migration, it can run and verify the change on its own branch before that change reaches production. Because each branch has its own database state, many agents or developers can work on different features in parallel without conflicts.

Automated testing and CI/CD integration

When a developer or AI agent opens a pull request, a matching database branch can be created automatically through the AWS API, the AWS CLI, or an Amazon EventBridge action, so the full application stack, code and database together, is tested in isolation. Teams can validate functionality and see how schema changes such as new indexes or query optimizations affect resource consumption. If tests fail, the branch is discarded with no cleanup. Once tests pass, the pipeline applies the migration to production with tools such as Liquibase or Flyway.

Secure development with production data

Branching gives developers and agents a secure way to use production data for development, testing, and validation. Each branch inherits the parent cluster's encryption at rest (AES-256) and in transit (SSL/TLS). Access to individual branches can be governed through IAM policies and password-less IAM authentication, so developers and agents reach only the branches they are authorized to use. Dynamic data masking policies set on the parent are enforced within each branch, so sensitive data stays masked. This pattern extends naturally to customer-specific sandboxes for onboarding and training, preview environments, and proof-of-concept deployments, all without affecting production and with Aurora's full security posture.