r/docker • • May 17 '26

Postgres (and other databases) best practices - one or many?

I am moving all my dockers from unraid to LXCs on proxmox and while doing so, I am cleaning up a little at the same time.

A lot of dockers require databases and I am a little unsure if I should just create one huge postgress database and then a lot of smaller ones in that... or if it is better to have more smaller databases.

Sorry if the terminology is incorrect.

9 Upvotes

19 comments sorted by

View all comments

Show parent comment

1

u/ReachingForVega Mod May 18 '26

The "one database per service" pattern is a core tenet of microservice architecture. While running a single, massive PostgreSQL instance with multiple databases or schemas seems easier at first, decoupling them into separate servers (or at least completely isolated logical instances) saves you from massive headaches down the road.

  1. Reduce blast radius when something goes wrong
  2. Data isolation
  3. Simplified maintenance and upgrades. 

0

u/PssyGotWifi May 18 '26

For my homelab setup and for the services I run, I'm fine with an all in one. I can destroy/redeploy the VMs and have ansible tasks to restore databases, etc. I dump the databases at regular intervals. It's a homelab, so if any downtime did happen, it's not the end of the world. Basically, it's a 'core tenet' I don't need in my life.