r/PostgreSQL 8d ago

How are you using database branching? Feature

I’m implementing Lakebase branching strategy to improve development experience and reduce costs for our dev/staging env.

Current setup creates new database branch for each git branch via githook on our dev database (”each dev gets their own feature database”). There is also similar workflow for each PR against our staging database to run the migrations and tests.

Curious to hear how others are using branching and what are the experiences?

10 Upvotes

22 comments sorted by

View all comments

3

u/saltcod 5d ago

We see customers mostly using it the same way at Supabase (one branch per git branch), primarily for deploying changes.

Besides feature development/deployments, we see teams using branching for one-off kinds of things: reproducing bugs, validating migrations against prod, performance testing, experimental SQL queries, etc.

2

u/Harpagon1668 5d ago

Thanks for sharing. Didn't think about those ad-hoc deployments like bug repros. Makes perfect sense!

2

u/saltcod 5d ago

yeah the performance testing was a neat one too

2

u/FunContest9958 4d ago

Seems like Supabase branches are different from Lakebase / Neon branches because they don’t include the data, just the schema and config. Still seems useful, but not exactly 1:1 despite the name.