Skip to main content

Aurora PostgreSQL Branches Let You Test Migrations on Real Data

9 min read

Set up Aurora branches

We wire branches into your pull requests, with masking and IAM set up on production first.

Aurora PostgreSQL can now make a throwaway branch of production for every pull request or coding agent, with real data, copied masking and no branching fee. How it works, what it catches, and the limits of the preview.

What AWS Announced

On December 2, 2026, during re:Invent, AWS released database branching for Amazon Aurora PostgreSQL as a preview. A branch is an isolated copy of a production database with the real data in it. You can read it, write to it and break it, and nothing you do reaches production or any other branch.

The idea is simple and long overdue for teams on Aurora. Every developer, every pull request and every AI coding agent can get its own branch of production, run a migration against real data, and throw the branch away afterwards. Nobody waits for a shared staging database, and nobody discovers on release night that the migration behaves differently on 200 million rows than it did on a test database with a few thousand.

AWS frames the launch around coding agents, which change application code and schemas faster than most teams can test them. The benefit is just as real for a team of three people with no agents at all.

How a Branch Works

A branch does not copy the whole database. It uses copy-on-write storage, so it starts by sharing production's data and stores only the pages that change inside the branch. A branch that only runs a migration and a few queries therefore stores very little.

PropertyWhat AWS documents
EngineAurora PostgreSQL 17 and later
StorageCopy-on-write, you pay only for data changed in the branch
ComputeIts own serverless compute, 0 to 16 ACUs, scales to zero when idle
EndpointEach branch has its own endpoint
Branches per databaseUp to 50
LifetimeA time to live you choose, up to 90 days, cannot be turned off
Branching feeNone
Regions in previewUS East (Ohio), Europe (Frankfurt), Asia Pacific (Mumbai)

There is no separate charge for branching itself. You pay for the serverless compute a branch uses and for the data changed inside it, at the existing Aurora Serverless rates. Because compute scales to zero, a branch that sits idle between test runs costs only its changed storage.

A branch can be made from the cluster or from another branch, and branches can also be made from an Aurora clone. Each branch shows its own metrics in CloudWatch Database Insights.

Security Comes From Production

A branch copies production's database users and roles, encryption and dynamic data masking policies. IAM controls who may create, use and delete branches, and the controls can be narrowed by tags.

This design has one consequence that every team should understand before the first branch exists. A branch does not hide private data on its own. It inherits whatever production already has. If customer names, emails and card numbers are visible to a user on production, they are visible to that user on every branch. If you want developers or agents to test on real data without seeing personal details, set up masking on the sensitive columns in production first, and give testers a database user without admin rights. Every branch made afterwards carries those rules.

For agents, AWS suggests one more layer. Tag each branch with the agent that created it, and write an IAM policy that lets an agent sign in only to branches carrying its own name and never to production or as the admin user. Under GDPR, a test environment that holds real personal data needs the same protection as production.

Creating and Using a Branch

Branches can be managed from the console, the AWS CLI, the SDKs and the AWS MCP Server, which coding agents use. With the CLI, a branch of a cluster that lives for 24 hours and scales up to 16 ACUs looks like this:

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 lists the branches with their status, endpoint and expiry time. You connect to a branch's endpoint like any other PostgreSQL database, with an IAM token from aws rds generate-db-auth-token if the cluster uses IAM sign-in. When the work is done before the time to live runs out, aws rds delete-branch removes it early.

During the preview, the capacity range and time to live cannot be changed after a branch is created, so pick them with the test in mind.

A Workflow for Pull Requests

The most useful pattern is one branch per pull request. AWS points to Amazon EventBridge, GitHub Actions or AWS CodePipeline to create a branch when a pull request opens and delete it when it closes. A typical flow looks like this:

  1. A developer or an agent opens a pull request that contains a migration.
  2. The pipeline creates a branch of production with a short time to live, for example 24 hours.
  3. The pipeline runs the migration on the branch with the same tool that will run it on production, such as Flyway, Alembic, Prisma Migrate or Rails migrations.
  4. The application's tests run against the branch, so they see the migrated schema and real data.
  5. The result goes back to the pull request, and the branch is deleted when the pull request closes or the time to live expires.
  6. After review, the pipeline applies the same migration to production the normal way.

The last step matters, because a branch cannot be merged back into production. It only proves that a change works, and the change still reaches production through the usual pipeline.

What Real Data Catches

Testing on real data catches a class of problems that a small test database hides almost every time. Some examples from PostgreSQL that branches make visible before release:

  • Adding a NOT NULL constraint fails when some old rows still hold nulls that nobody remembered.
  • Creating a unique index fails on duplicates that crept in years ago.
  • Changing a column's type, for example integer to bigint, rewrites the whole table and holds a lock that blocks writes for as long as the rewrite takes.
  • A plain CREATE INDEX blocks writes on a big table, where CREATE INDEX CONCURRENTLY would not.
  • A data backfill written as one UPDATE runs for an hour on production volumes and fills the write-ahead log.
  • A query that the new code adds is fast on test data and slow on the real distribution of values.

Each of these shows up on a branch as an error, a long runtime or a plan worth reading, which is far cheaper than finding it in production with customers waiting.

What a Branch Is Not

AWS is clear about the limits, and they are worth repeating before anyone builds a process on top.

  • It is not for load testing. A branch has its own serverless compute of up to 16 ACUs, which can differ a lot from production's instances, so its timings are a warning sign rather than a forecast.
  • It cannot be merged back. Changes reach production through your normal migration tooling.
  • It does not mask data by itself. It copies production's masking and nothing more.
  • Its lifetime cannot be switched off. Branches live for at most 90 days and are meant to be thrown away.
  • A clone cannot be made from a branch.

Branches, Clones and Blue/Green

Aurora already had two ways to make a separate copy, and branching sits next to them rather than replacing them.

OptionWhat it isBest for
Database branchCopy-on-write copy with managed serverless compute, deleted within 90 daysMany short tests, one per pull request or agent
Aurora cloneFull separate cluster with copy-on-write storage and compute you configure, kept until you delete itDevelopment, integration and performance testing
Blue/Green deploymentA staging copy of the whole setup that you switch over toRolling out engine upgrades and large changes to production

Branches can be made inside a blue or green environment, but they do not move over at switchover.

Where It Is Strong

  • It tests migrations on real data, which is where most painful migration failures come from.
  • Every pull request or agent gets its own copy, so tests run in parallel instead of queuing for a shared staging database.
  • There is no fee for branching itself, and idle branches scale to zero.
  • Branches clean themselves up, so forgotten copies of production do not pile up for months.
  • Masking, roles and encryption come from production, so a good setup there protects every branch automatically.
  • Frankfurt is in the preview, so teams with EU data can try it without leaving the EU.

Where It Falls Short

  • It is a preview, with three Regions, no change to settings after creation and no promise yet about general availability.
  • It needs Aurora PostgreSQL 17 or later, so clusters on older versions need a major upgrade first.
  • Aurora MySQL and RDS for PostgreSQL are not covered.
  • Compute is capped at 16 ACUs, which limits how far timings on a branch reflect production.
  • It inherits production's access rules exactly, so a weak setup there becomes a weak setup on every branch, with real personal data in it.

What to Do Now

For teams already on Aurora PostgreSQL 17 in Frankfurt, Ohio or Mumbai, a branch is worth trying on the next migration that makes anyone nervous. Before giving branches to a whole team or to agents, check the sensitive columns in production and set up masking and a limited database user, since every branch will copy those rules.

Teams on Aurora PostgreSQL 16 or older can use this launch as one more reason to plan the upgrade to 17. Teams on plain RDS for PostgreSQL or on self-managed PostgreSQL can get a similar result today with Aurora clones or with snapshot restores, at the cost of more manual work.

We covered the rest of the first conference days in re:Invent 2026 Opens With a Rebuilt AWS Amplify and Amazon Ergo Opens Its Weights at $1 per Million Tokens. If you would like branches wired into your pull requests, with masking and IAM set up on production first, our AWS cloud management team can do it for your cluster.

Sources

Read how we handle it in AWS Cloud Management.

Related News

Cloud

On July 30 AWS Quietly Trims a Dozen Services and Walking Back Its Own AI Bets Is the Real Story

On June 30, 2026, AWS closed roughly a dozen services to new customers effective July 30, and the list is mostly its own first-generation AI and search products: Kendra, Q Business, and Bedrock Agents, now renamed Classic. But retire means three different things in this announcement, maintenance mode where existing customers keep running fully supported, sunset with a real end-of-support date, and already ended. This sorts every service into its bucket, explains why the AI cull is a consolidation onto Bedrock rather than a retreat, and covers the two migrations that need actual work: WorkSpaces PCoIP to DCV by October 2027, and Kendra to Bedrock Knowledge Bases.

Cloud

Azure Returns 410 Gone for GPT-4o on October 1 and Auto-Upgrade Skips the Deployments That Matter

On October 1, 2026, Azure OpenAI in Microsoft Foundry retires the GA gpt-4o (2024-11-20) and gpt-4o-mini (2024-07-18) versions, after which calls to a retired deployment return HTTP 410 Gone. Standard-family deployments are auto-upgraded region by region, but Provisioned (PTU) deployments and anything set to NoAutoUpgrade are not, and Microsoft says the date is not extendable.

Cloud

AWS Lambda Can Now Answer HTTP Directly With Web Functions

AWS has added Lambda Web Functions, where your code runs its own HTTP server and one warm environment serves several requests at once. Only Node.js is supported for now, in five Regions, and existing functions are being renamed Event Functions.