
Introducing database branching for Amazon Aurora PostgreSQL
Amazon Aurora PostgreSQL now supports database branching, which lets you test changes on a copy of production without affecting it. You can create up to 50 branches per database, and each one stores only the data you change.
devex engineer @ aws | new grad goofin | opinions are mine!
Introducing database branching for Amazon Aurora PostgreSQL
Database branching just launched for Amazon Aurora PostgreSQL. You can now make a branch of your production database: your own isolated copy, with real data, that you can read, write to and break. Nothing you do touches production or any other branch. It's available now in preview on Aurora PostgreSQL 17 and up.

The problem branches solve
Developers and their coding agents change app code and database schemas all the time, but testing hasn't kept up. With database branching, every agent, task or pull request gets its own isolated copy of production with real, protected data, so you can test changes in parallel without risking customers, and the branch cleans itself up when you're done.

Features at a glance
What you get
- Your own isolated copy with production's real data
- Its own serverless compute (0 to 16 ACUs) and its own endpoint
- Up to 50 branches per database
Cost and cleanup
- Copy-on-write: you pay only for the data you change and the compute you use
- Scales to zero when idle
- Deletes itself after the time to live you pick, up to 90 days
- Fully managed: no instances, backups or upgrades to handle
Security
- Copies production's database users, roles, masking and encryption
- IAM controls who can make, use and delete branches, down to tags

How you work with it
- Console, CLI, SDKs or the AWS MCP Server for coding agents
- Amazon EventBridge to make and delete branches with your pull requests
- Per-branch metrics in CloudWatch Database Insights
- Aurora PostgreSQL 17 and up
What a branch isn't
A branch is made for testing, and it has a few limits:
- You can't merge a branch back into production. You apply the change to production the way you normally do.
- It's not for load testing, because its compute can differ from production.
- It doesn't hide private data on its own. It copies whatever security rules production already has. If you want private data hidden, set up masking on production first, and every branch copies it.
- You can't turn off the lifetime. Branches are made to be thrown away.

When a change passes on a branch, you ship it the normal way: open it for review, and your pipeline applies it to production with a tool like Flyway or Alembic.
When to use a branch
- AI-assisted development: each agent or agent task gets its own branch, so agents test migrations on real data without breaking each other.
- CI/CD preview environments: with Amazon EventBridge , GitHub Actions or AWS CodePipeline makes a branch when a pull request opens and deletes it when it closes.
- Testing migrations on real data: catch problems, like a column change that rewrites a big table and blocks writes, before they reach production.
- Working safely with private data: developers and agents use production data while inherited masking hides names, emails and card numbers.
Branches vs clones vs Blue/Green
Aurora already has other ways to make a separate copy. Branches add a throwaway option for testing.
- Database branch: your own isolated, copy-on-write copy for testing. It has serverless compute managed for you and deletes itself within 90 days. It's best for many short tests, one per agent or pull request. You can't merge it back, and you can't make a clone from a branch.
- Aurora clone: a full, separate database cluster with copy-on-write storage and compute you configure. It lasts until you delete it, and it's best for dev, integration testing and performance testing. You can make a branch from a clone.
- Blue/Green deployment: a staging copy of your whole setup that you switch over to when you roll out changes to production. You can make branches in blue or green, but they don't move over at switchover.
Why this matters for AI agents
AI agents work in parallel, and they make mistakes. Branches fit that well. You can give every agent its own branch, so each one tests on real data without waiting for the others.
To keep agents safe on their branches, pair branches with two things you set once on production:
- Data masking on private columns, plus a database user for the agent with no admin rights. The agent sees stars where names, emails and card numbers would be.
- Tag-based IAM. Each branch gets tagged with the agent that made it. The IAM policy only lets an agent sign in to branches with its own name on them. It also blocks agents from signing in as the admin or getting into production.


How to start
You can make a branch with the CLI, the console, the SDKs or your own coding agent. If you use a coding agent like Kiro , set it up with the Agent Toolkit for AWS :
aws configure agent-toolkitIt connects your agent to the MCP Server and installs skills, so your agent gets the steps and best practices it didn't learn in training.
In the console, open your cluster and choose Create branch. You pick what to branch from (the cluster or an existing branch), a name, the capacity range and the time to live. During preview, you can't change these settings after the branch is made.

After you make a branch, it shows up on your cluster's Branches - Preview tab, with its time to live counting down.

Open it to see its details, its own endpoint on the Connection tab and its own CloudWatch metrics.

With the AWS CLI
Make a branch of your cluster that lives for 24 hours and scales up to 16 ACUs:
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-nameList your branches, with each one's status, endpoint and expiry time:
aws rds describe-branches --db-cluster-identifier my-clusterConnect to the branch's endpoint like any other database. With IAM sign-in, get a token first:
TOKEN=$(aws rds generate-db-auth-token \ --hostname <branch-endpoint> --port 5432 --username app_dev)psql "host=<branch-endpoint> port=5432 user=app_dev dbname=postgres sslmode=require password=$TOKEN"Delete it early if you're done before its time to live runs out:
aws rds delete-branch \ --db-cluster-identifier my-cluster \ --branch-name my-branchWatch the demo
Youtube: Aurora Databases Now Has Branches, So We Let Agents Try It Out

If you're new to databases or agents, start with one branch and build from there. Learn more on the Aurora features page .
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article