Aurora PostgreSQL database branching: migrate a branch, not production
One production table, one branch, one migration on the branch only. Everything is deleted at the end.
AWS Cloud
Region us-east-2
VPC no internet gateway
Two private subnets
Presenter
quickstart.py
Amazon RDS API
cluster and branch calls
RDS Data API
SQL over HTTPS
AWS Secrets Manager
managed master secret
Parent cluster
Serverless v2, 0 to 1 ACU
table orders
Branch
copy-on-write, 0 to 1 ACU
orders + loyalty_tier
1
2
3
4
5
1
2
3
4
5
LINES
Create and delete resources
SQL through the Data API
Branch shares the parent's data pages
Read the secret
FLOW
The script creates the VPC, the encrypted Serverless v2 cluster and, later, the branch.
It creates and fills the orders table on the parent through the Data API.
CreateBranch makes a copy-on-write branch with its own serverless compute.
The migration (ADD COLUMN) runs on the branch only; both sides are then queried.
The Data API reads the password from the managed secret; the script never sees it.