Neon
02 / 02

Neon: Branching, Autoscaling & When It Fits

Neon: Branching, Autoscaling & When It Fits

Copy-on-Write Branching

A branch is a near-instant, isolated copy-on-write snapshot -- similar to a Git branch. It initially shares the parent's underlying data, only diverging (consuming additional storage) as changes are actually made, so creation takes seconds rather than the time to provision and copy a whole new database.

Per-PR Preview Databases

A common pattern pairs branches with CI/CD -- creating a fresh, isolated branch per pull request preview deployment. This avoids test data collisions between concurrent feature branches, a problem a single shared staging database is prone to.

Testing Risky Migrations Safely

Running a potentially destructive or long-running migration against a branch with production-like data first lets a team catch unexpected errors or excessive lock time before applying it to the actual production database.

Autoscaling for Variable Traffic

Compute automatically scales up during traffic spikes and back down during quiet periods -- avoiding both over-provisioning (wasted cost) and under-provisioning (poor performance). The benefit is most pronounced for variable, spiky workloads; a consistently high steady-state workload sees less differential advantage.

Connection Pooling

Serverless/autoscaling environments -- many short-lived function invocations each needing a DB connection -- benefit from connection pooling (like PgBouncer) to avoid overwhelming the database with excessive direct connections.

Keep your own version of these notes — editable, searchable, and organised by your stack.

Start free