Branch Like Production: Five Checkpoints Before You Trust It
A five-checkpoint workflow for spinning up a database branch that behaves like production: clone config, replay migrations, deploy code, pull fresh data, then verify before you trust it.
A database branch is an independent project, not a mirror: it needs its own settings, schema, code, and data before anyone can test against it. This explainer walks the order that works — copy the main project's Postgres, Auth, and Realtime config in one restart, replay migrations from the repo or the main history with one transaction per file, deploy functions (only changed ones on each push), then stream real-time source data so the branch never decides on stale rows. It ends on the verification habits that separate a usable branch from a broken one, including the difference between a DEAD step that halts dependents and a PAUSED warning that does not.
FAQ
Why don't my Auth secrets and env vars carry over to a new branch?
When a branch is created, main project settings for Postgres, Auth, and Realtime are copied and applied with a single Postgres restart, but Auth secrets are not included. You have to supply branch-specific secrets before testing auth flows. Also keep key types straight: publishable and anon keys are for client apps, while secret and service keys bypass Row Level Security.
What is the difference between a DEAD and a PAUSED step during branch setup?
DEAD means a step failed, and it stops the steps that depend on it, so the branch is left incomplete and needs attention before use. PAUSED is only a warning: it does not block subsequent steps, so setup continues and you can review the warning alongside the finished environment.
How do I stop a branch from testing against stale data?
Do not rely on a scheduled copy or a separate replicated store, because sync lag turns into wrong answers fast, especially for automated agents. Prefer streaming source records into the branch in real time so it reads current rows, and keep multi-step writes atomic so partial updates never linger.
A practical how-to for engineers who need to turn brand from a style guide into a governed signal pipeline: anchor on jobs, model brand roles, unify signals, tokenize meaning, and close the loop with measurement.
A five-step path from fragmented payment silos to a canonical, governed record that AI agents can act on: model the payment, unify the copy, stream events, wrap writes in transactions, and scope agent authority.
A five-step loop for treating bots as accountable actors: verify identity, honor opt-out preferences, measure sustained behavior, band trust, and bound blast radius.
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.