
Why use branches?
- Isolated: Changes in a branch stay in that branch. Your production data is never touched.
- Fast & Efficient: Creating a branch takes seconds and costs nothing in storage until you make changes.
- Zero Overhead: Branching happens without slowing down your main database.
Common Use Cases
Safe Development & Testing
- Preview Environments: Give every pull request its own dedicated database.
- Real Data Testing: Test new features against a copy of production data to catch bugs early.
- Schema Validation: Try out risky schema changes on a disposable branch before applying them to
main.
Instant Recovery & Debugging
- Forensics: Create a branch from a past timestamp to investigate exactly what the database looked like when an error occurred.
- Data Recovery: If data is accidentally deleted, spin up a branch from the moment before the deletion to recover it.
Analytics Isolation
- Heavy Queries: Run complex analytical queries on a separate branch so you don’t slow down your transactional application.
Branching vs. Read Replicas
While both branches and read replicas provide copies of your data, they serve different purposes:| Feature | Branch | Read Replica |
|---|---|---|
| Data State | Static snapshot at creation time (diverges as you write) | Continuously synchronized with the primary |
| Writes | Read-Write (Independent) | Read-Only |
| Best For | Development, Testing, Recovery, Experiments | Scaling read traffic, High Availability |
| Impact | Isolated from primary | Linked to primary (replication lag) |
How it Works
Every RelytONE project starts with a primarymain branch. You can create new branches from main or any other existing branch.
Each branch functions as an independent database with its own connection string. You can connect to it using standard PostgreSQL tools. When you are finished with a task, simply delete the branch to keep your environment clean.