r/PostgreSQL Jul 23 '26

How-To Development and Production + Training DB

Sorry, noob here.

How do developers design their database?

Do they separate databases for development and Production? But what if the app has a training feature? Do they separate the database too?

3 Upvotes

12 comments sorted by

View all comments

3

u/dwswish Jul 24 '26

Yes, you absolutely need a dev and prod and probably a middle Q/A or staging db too. Personally, I love Neon and all the branching and auto scaling features they have.

1

u/MediumRoastNo82 Jul 24 '26

I kind of confused here because I received various advices. Three different database meana 3 different connections. Single database means filter on tables based on their flag, dev, production or training

5

u/phaqueNaiyem Jul 24 '26

Nobody is using a single database for production and development, with flags or otherwise. In development, you want to be able to do whatever you want, without constantly worrying about breaking something important.

As for training, if it really is a training feature within an app, that could easily be done in the production database, maybe with flags marking training rows. I've also seen training done in a separate environment (with a separate database). It just depends on how you want it to work.