Branching
Branches are isolated database deployments that provide separate environments for development, testing, and restoring from backups.
Overview
Branches on Zektor.io PostgreSQL are isolated database deployments that provide you with separate environments for development and testing, as well as restoring from backups.
Every PostgreSQL database starts with a default main branch. You can create additional branches from backups for testing, development, or disaster recovery.
How Branching Works
When you create a branch, Zektor.io provisions a new, independent database instance that contains a copy of your data from a specific point in time. Each branch:
- Has its own connection credentials
- Runs on its own compute resources
- Can be independently scaled
- Is billed separately based on the cluster size you choose
Creating a Branch
From the Branches Page
- Navigate to your instance's Branches tab
- Click New Branch
- Provide a name for the branch
- Select a cluster size
- Click Create Branch
From a Backup
You can also create a branch by restoring from a backup:
- Navigate to your instance's Backups tab
- Find the backup you want to restore
- Click Restore on the backup entry
- Provide a branch name and select a cluster size
- Click Restore
This creates a new branch with all data as of the backup's point in time.
From Point-in-Time Recovery (PITR)
PITR lets you restore to any specific timestamp:
- Navigate to your instance's Backups tab
- Click Restore Backup
- Select the exact date and time to restore to
- Choose a cluster size and optionally set a branch name
- Click Restore
Note: The target restore time must be at least 2 minutes in the past.
Viewing Branches
All branches for a database instance are visible in the Branches tab. For each branch, you can see:
- Name — The branch identifier
- Status — Active, Provisioning, or Stopped
- Cluster size — The compute tier
- Created — When the branch was created
Connecting to a Branch
Each branch has its own set of connection credentials. Navigate to a branch's Settings tab to find:
- Host and port
- Username and password
- Connection string
See Connecting for detailed instructions on using these credentials with your preferred client or ORM.
Deleting a Branch
- Navigate to the Branches tab
- Select the branch you want to delete
- Click Delete Branch in the branch settings
Warning: Deleting a branch permanently removes the database and all its data. This action cannot be undone.
You cannot delete the default main branch.
Branch Behavior
- Branches are independent — Changes made to a branch do not affect the source database or any other branch
- Schema changes — Each branch maintains its own schema. Changes made on one branch are not applied to others
- Extensions — PostgreSQL extensions may need to be reinstalled on restored branches
- No automatic sync — Branches do not receive updates from the main branch after creation. They are a snapshot from the point of creation.
Use Cases
| Use Case | Description | Recommended Tier |
|---|---|---|
| Disaster Recovery | Restore from a backup to verify your data is intact | Same as production |
| Testing Migrations | Test schema changes against real data before applying to production | Starter or Standard |
| Development | Work on schema changes without affecting production | Starter |
| Data Analysis | Run expensive queries on a branch to avoid impacting production | Standard or Pro |
| Pre-release Validation | Validate application code against a copy of production data | Same as production |
Tip: Use a smaller (cheaper) cluster size for development and testing branches. You can always scale up if needed.
Next Steps
- Backups & PITR — Learn about backup schedules and point-in-time recovery
- Connecting — Connect to your branch
- Scaling — Resize a branch's cluster
- Pricing — Understand branch billing