← sources

Does every PR get its own database where you work?

source: reddit (reddit:devops)published 2026-09-29 15:43ingested 2026-09-30 02:39

retained text

I’ve been looking at database branching and per-PR setups and the idea is that CI creates a branch when the PR opens, applies the migrations in it, runs integration tests against that, then deletes the branch when the PR closes.

This makes sense to anyone who's had two schema changes land in the same staging database and then lost hours to working out whose migration broke whose tests. 

But what I can't tell from the outside is the operational side. For instance, branch creation has to be fast enough not to slow CI, and something has to clean up after abandoned PRs or you could end up with a lot of forgotten environments.

For anyone running this, how did you handle cleanup, and did CI time improve?

document fetched 2026-09-30 00:26 · canonical https://reddit.com/r/devops/comments/1wtdl9t/does_every_pr_get_its_own_database_where_you_work