🚀 Ready to transform your cloud infrastructure? Get Started →

Aurora PostgreSQL database branching guide: isolated copy-on-write branches of a production database for pull requests and AI agents

Aurora PostgreSQL Database Branching: Test Migrations on Production Data Safely

Most database incidents do not start with bad code. They start with a migration that looked fine on a small staging database and then locked a large production table, or broke a query no one tested against real data. As AI coding agents push schema changes faster than ever, a single shared staging database becomes a bottleneck. On 2 December 2026, AWS announced database branching for Amazon Aurora PostgreSQL in preview, a way to give every developer, pull request and agent its own isolated copy of production data.

This guide explains what Aurora PostgreSQL database branching is, how it differs from clones and Blue/Green deployments, what it costs, and how to roll it out safely in your delivery pipeline.

What Is Aurora PostgreSQL Database Branching?

The Aurora User Guide describes a database branch as an isolated, queryable, copy-on-write version of your Aurora cluster’s data. Developers and AI coding agents use branches to test schema and data changes, such as migration scripts, against production-derived data without affecting the production cluster or any other branch.

The key properties are:

  • Copy-on-write storage. A branch shares the parent’s data pages at first and stores only the pages you change, so creating one does not mean copying the whole database.
  • Its own serverless compute and endpoint. Each branch gets its own read/write endpoint and serverless compute that scales to zero when idle.
  • Automatic cleanup. Every branch has a time to live (TTL). When it expires, Aurora deletes the branch. According to the AWS Builder Center launch article, the TTL can be up to 90 days and cannot be turned off.
  • Inherited security. Branches inherit the parent cluster’s encryption, IAM controls, database users and roles, and dynamic data masking policies.
  • Parallel use. You can run many branches at once (up to 50 per database, per AWS), so multiple pull requests and agent tasks can test changes at the same time.

Availability and Pricing

During preview, branching works with Aurora PostgreSQL version 17 and higher in US East (Ohio), Europe (Frankfurt) and Asia Pacific (Mumbai). For teams in India, Mumbai support means you can try it close to your existing workloads. There is no additional charge for branching itself: you pay only for the serverless compute your branches consume and the data changed within each branch, at existing Aurora serverless rates. AWS also states that, as a preview, it is not recommended for production workloads.

Branches vs Clones vs Blue/Green Deployments

Aurora already offers ways to make a separate copy of a database, so it helps to know where branches fit:

  • Database branch: a short-lived, copy-on-write copy with managed serverless compute that deletes itself. Best for many quick tests, one per agent or pull request. You cannot merge a branch back, and you cannot create a clone from a branch.
  • Aurora clone: a full, separate cluster with copy-on-write storage and compute you configure. It lasts until you delete it and suits long-running dev, integration and performance testing. You can create a branch from a clone.
  • Blue/Green deployment: a staging copy of your whole setup that you switch over to when rolling out changes. You can create branches in blue or green, but they do not move over at switchover.

One important point: a branch is not a merge tool. When a change passes on a branch, you ship it the normal way, through code review and a migration tool such as Flyway or Alembic in your pipeline.

How to Create and Use a Branch

You can manage branches from the AWS Management Console, AWS CLI, SDKs, or the AWS MCP Server for coding agents. In the console, open your cluster and choose Create branch, then pick the source, a name, the capacity range and the TTL. During preview, these settings cannot be changed after the branch is created.

With the AWS CLI, a 24-hour branch that scales up to 16 ACUs looks like this (from the Builder Center article):

aws rds create-branch \
  --source-db-cluster-identifier my-cluster \
  --branch-name my-branch \
  --ttl-seconds 86400 \
  --scaling-configuration MaxCapacity=16 \
  --tags Key=owner,Value=my-name

aws rds describe-branches --db-cluster-identifier my-cluster

aws rds delete-branch \
  --db-cluster-identifier my-cluster \
  --branch-name my-branch

You connect to the branch endpoint like any other PostgreSQL database, for example with an IAM authentication token passed to psql. In a hands-on test by Classmethod’s DevelopersIO, a new branch became available in about 100 seconds using AWS CLI 2.43.2, and the same test noted that branches run on a single compute instance without Multi-AZ failover, automated backups or an SLA.

Practical Use Cases

1. Preview Environments for Every Pull Request

AWS suggests using Amazon EventBridge with GitHub Actions or AWS CodePipeline to create a branch when a pull request opens and delete it when the pull request closes. Your CI job runs migrations and integration tests against real data, and the branch disappears on its own if cleanup fails. If you are building this kind of pipeline, our CI/CD services team can help you wire it in.

2. Safe Sandboxes for AI Coding Agents

Agents work in parallel and make mistakes. Giving each agent task its own branch lets it test migrations without breaking other agents or production. AWS recommends two guardrails set once on production: data masking on sensitive columns plus a non-admin database user for agents, and tag-based IAM so an agent can only connect to branches tagged with its own name.

3. Catching Risky Migrations Early

Running a migration on production-sized data reveals problems a tiny staging database hides, such as a column change that rewrites a large table and blocks writes. Per-branch metrics in CloudWatch Database Insights help you see how heavy a migration really is.

Limits to Plan Around

  • No merge-back. Changes must still be applied to production through your normal release process.
  • Not for load testing. Branch compute can differ from production, so performance numbers are not comparable.
  • Masking is inherited, not automatic. A branch copies whatever security rules production has. Set up masking on production first if branches will be used with sensitive data.
  • Preview constraints. Limited Regions, PostgreSQL 17+ only, fixed settings after creation, and behaviour that may change before general availability.

A Simple Rollout Plan

  1. Check eligibility. Confirm your cluster runs Aurora PostgreSQL 17+ in a supported Region, or test with a clone or a new cluster first.
  2. Protect sensitive data. Configure dynamic data masking and least-privilege database roles on the parent before anyone branches.
  3. Tag and scope access. Require an owner tag on every branch and use tag-based IAM policies.
  4. Automate in CI. Create a branch per pull request, run migrations and tests, then delete it. Keep TTLs short.
  5. Watch costs. Set a low maximum ACU for routine tests, since you pay for compute and changed data.

For broader help modernising how your team ships application and database changes, see our cloud DevOps services.

Frequently Asked Questions

Does Aurora database branching cost extra?

No. There is no additional charge for branching. You pay for the serverless compute your branches use and the data changed within each branch, at existing Aurora serverless rates.

Which Aurora versions and Regions support branching?

In preview, Aurora PostgreSQL 17 and higher in US East (Ohio), Europe (Frankfurt) and Asia Pacific (Mumbai). Aurora MySQL is not part of this preview.

Can I merge a branch back into production?

No. A branch is for testing. Once a change passes, apply it to production through your usual migration tooling and review process.

Is branch data protected?

Branches inherit the parent cluster’s encryption, IAM controls, users, roles and dynamic data masking policies. If masking is not configured on production, the branch will not hide sensitive data on its own.

Test Database Changes Without the Risk

Aurora PostgreSQL database branching makes it practical to give every pull request and AI agent a realistic, isolated database that cleans itself up. The real value comes from pairing it with masking, tag-based IAM and an automated pipeline. If you would like help designing that setup, talk to the Shanav team for a free consultation.