How branching works
Branch creation is built on the same backup and recovery infrastructure used for Point-in-Time Recovery (PITR). When you create a branch, ClickHouse Managed Postgres restores a base backup from object storage, replays the required WAL segments to reach the requested recovery point, and provisions a new PostgreSQL deployment from the recovered state. Once recovery completes, the branch operates independently of the source database. The resulting branch is a complete copy of the source database at the selected point in time.Common use cases
Development and testing
Create a branch from a production or staging database to validate application changes, migrations, or new features against realistic data.Staging environments
Maintain a staging environment that closely mirrors production without affecting production workloads.Data validation
Test schema changes, indexing strategies, and query optimizations before deploying them to production.Recovery and investigation
Recover a database to a specific point in time for troubleshooting, auditing, or validating application behavior.Branch sizing
Branches are independent PostgreSQL deployments and can be sized separately from the source database. For example, a production deployment may run on a larger configuration while a development or staging branch can use a smaller compute profile to reduce costs. This lets teams create temporary environments without matching the compute resources of production.Branch creation time
Because ClickHouse Managed Postgres uses NVMe-backed PostgreSQL storage, branches are restored from backups rather than created through storage-level copy-on-write mechanisms. As a result, branch creation isn’t instantaneous. Typical branch creation times range from several minutes to tens of minutes, depending on:- Database size
- Backup size
- Recovery point
- Amount of WAL that must be replayed
- Overall cluster configuration
Branches vs local development
A common question is whether every developer should use a production branch as their development environment. While branches are useful for testing, validation, and staging workflows, they’re generally not the recommended approach for day-to-day application development. Each branch is a separate PostgreSQL deployment that must be restored from backups and maintained independently. Creating large numbers of branches can increase infrastructure costs and operational complexity. For most organizations, we recommend:- Using PostgreSQL branches for staging, testing, debugging, and validation workflows.
- Using local PostgreSQL environments for day-to-day development.
- Generating synthetic development datasets or using sanitized datasets where appropriate.
- Avoiding routine development directly against production-derived branches.