One database container or many?
I'm self hosting a lot of small apps that require databases to function. So far, each stack has its own database, but I'm wondering if it would be better to centralise the data into one single database instance
All the apps are low traffic (it's just me), and security concerns are minimal (no sensitive data)
Does anyone have any advice on this?
Resource overhead when using multiple instances is negligible. But the benefit is if an app move to a nee major version of the db, then you can migrate easily. Also you don't have to worry about permissions, multi tenancy, roles, etc.
Only benefit of using a centralised db is easier back ups. But that is not enough for a centralised db IMO.
I use just one.
I have multiple services on it (docker containers, custom data tracking) and have not had an issue.
I consistently surprised at how low my memory usage is on one instance 330 mb.
The maintenance of keeping up a db each docker just isn’t worth it or necessary.
A similar question was here, a few days ago, maybe it helps:
https://sh.itjust.works/post/61811674
You will most probably hit the problem that I had: one app moved to a new (major) version of postgres and some other apps didn't support it. So in the end I'm using a DB for each service/app.
I did the opposite, I started with one database instance but kept having issues and the maintainer told me to use multiple so now I have a ton of separate ones