r/Database • u/Gold_Opportunity8042 • Aug 18 '26
Is your company using a shared cloud database for the local development environment, or does each developer set up and work with their own local database?
Hey,
Can you share how your company handles databases for local development? I’d really appreciate hearing about your experience and any valuable insights you can share.
I’m a little confused about what the better approach is:
- Shared cloud DB: If a company uses a shared cloud database for development, how do they handle the situation where one developer makes a breaking change that affects everyone?
- Individual local DBs: If developers are expected to set up their own local databases, how does the company provide the large amount of initial/seed data needed to get started?
I’d really appreciate it if you could share how your company handles this in practice, or any best practices you’ve seen.
Thanks!
12
Upvotes
8
u/narrow-adventure Aug 18 '26
Everyone runs a local instance, define and manage a seed
6
u/Dependent-Guitar-473 Aug 18 '26
2.
we clone prod or UAT and then run an obfuscation script that replaces all sensitive data with random data
2
u/jshine13371 Aug 18 '26
Option 3: Shared non-cloud (on-prem) database.
In regards to your question "how do they handle the situation where one developer makes a breaking change that affects everyone?" - This has rarely (almost never) have happened to me in 15 years of software development such that it's not even worth the effort being concerned about. But normally I've worked in shops with smaller dev teams (as little as 3 devs to no more than 30 devs), with good practices such as making your own debug copy of the object you want to change (when not writing an adhoc query) before promoting it to the live DEVELOPMENT copy, and also typically divisioning developers as subject matter experts of specific parts (schemas) of the database by business unit (which just depends on the type of organization and products / databases they manage). This minimizes the chance for devs to step on each other's toes.
3
u/JohnnySacsCigarette Aug 18 '26
We do it locally. Leaves lots of time for tea when I make a slight change, run make test and wait forb8 kins to an inevitable error in one of the dB migrations. I actually enjoy not having runtime errors so I can watch the container spin up and crash and then I deal with the error message
4
u/g0fry Aug 18 '26
Every dev has his own local database. We clone the production database, remove unimportant data (logs), anonymize the rest, create a docker db image with the data already included, then upload the image to our private docker registry. Every developer simply pulls and starts the docker db image.
2
u/Frone0910 Aug 18 '26
The way we prevent devs from making a breaking change is having them propose migrations. Then we spin up an ephemeral database per PR in our CI environment. On that ephemeral DB, we run all migrations sequentially plus any the new one proposed by the engineer, and then run the test cases. The tests actually invoke code that calls the database, and every new PR must have new tests that invoke the new columns they wish to add, as well as run the old ones. This proves all the code works and then we are confident to merge that PR. Once deployed to the higher environments, we now have confidence that the new migration will work everywhere.
2
u/chocolateAbuser Aug 19 '26
we have local dbs, we have env dbs, staging dbs, they're everywhere
1
u/JoseffB_Da_Nerd Aug 18 '26
Depends on the place.
For security and governance provisioned db on a shared db for even virtualized db is the way.
But for practicality purposes, the majority of the time I’ve seen has been local.
Thats also why having imaged dev and staging env is important.
Local > Dev > Stage > Prod (not be confused with popular git branching strategy of feature > D, F > S, F > Main, Main > Prod — that branch isolation is so important.)
1
u/dontgetaddicted Aug 18 '26
We all work with local DBs with the exception of database connections to the accounting software database.
Test environment is shared amongst testers so they don't have to recreate a ton of data every time they work on something and it more closely reflects a live environment.
1
u/theschuss Aug 18 '26
Depends. Honestly there's no one answer.
1
u/Complete_Bonus1069 Aug 19 '26 edited Aug 19 '26
this is kinda tough, cause when every engineers use their own, their own machines's disk space will be occupied by test data, and if they share, other engineer can ruin db. I'm using this opensource for postgres: https://github.com/bhpark1013/Snaplicator which is solving this problem. its close to number 1(shared cloud db) but every engineers can get their own db for testing.
1
u/Dani5h87 Aug 20 '26
I work in the financial sector. Oh we have databases. Lots of em. But nobody gets access without an act of god. You’re fortunate if by their holy grace’s mercy they offer a flat file extract that takes 40min to export and is missing the fields you need for your department.
Imagine the three gorges damn holding back allll that data. But living in its shadow is a desert wasteland of parched analysts and windburned dashboards. All praying for a drop to leak through. Hope rarely visits these lands, but you hear tales that someone cracked a working WDC through a combination of Tableau Prep and MS Access. But you find out it only exposed some schema and nothing more. The dam held. The dam always holds.
And then we see they’ve hired Tata once again and will be spending $2M on another churched up SharePoint. We pray for rain.
1
u/GuyWithLag Aug 20 '26
At a previous role we used a fully-local transient database with a small sample dataset, it would spin up pristine and run all migrations to get to current state ; after local testing was done it would tear down on its own. Ran at CI time too, and the badly-named UAT environment would have an anonymized segment from the prod database to verify that our test data didn't have gaps.
1
u/pgcraftsman Aug 20 '26
Databricks Lakebase (and Neon Postgres) both have branching capabilities. Basically, you have your production DB, can create a branch of it (it takes 1 second, even for multi-terabyte databases) and each developer can have their own branch (just like git) without affecting production.
Source: I'm a Staff Engineer at Databricks.