a single database for several services in proxmox? [DISCUTION] reddit / selfhosted ---------------------------------------------------------------------- roycorderov · 2023-11-29 21:45 what's up folks, I am always looking for how to improve my infrastructure and these days I have been thinking about the feasibility of creating an lxc container or a vm in my proxmox just to install a db like mariadb and all the other services in another lxc's that will need a db for example wordpress, odoo, speedtest tracker, n8n etc. will point to that lxc or vm with the db of mariadb (or another)... would it be good?, would it be bad? Would it be a good practice? Would it provide any bad performance? or would it be a benefit? what do you think? ---------------------------------------------------------------------- atliensarereal · 2023-11-29 21:58 i use a single VM for apps which need a database. the apps, sometimes lxc, docker, other VMs, each point to the database VM as the storage backend. may not be best practice to some, and there are some apps which i still have container-based databases (usually just if i'm testing something), but i've personally found that it's easiest to keep track of backups for a singular database VM than to wrangle backups for 10+ database hosts. your situation may warrant a different setup, but this is what has worked best for me ---------------------------------------------------------------------- roycorderov · 2023-11-29 22:13 I think I can understand you because I currently have around 13 LXC CT and 4 vms and within each of those lxc I can have up to 6 or 7 applications or services that use databases; and I think that precisely because of what you describe I think that is why I would like something more centralized, because sometimes the backup can be a bit of a headache and at the same time the resources since each service can call the db that that service created when installing, making many services call several db's and what I think It would consume more resources (of something), but (I believe) that if the db is concentrated in a single place and all the services call that only place, I think it would improve the performance (of something) just as you describe that you have, and you would have a simpler and easier way to create the vm's and lxc's and the backups... of course the vm or lxc that will host that db should have good resources and a backup system more often and perhaps another db for ' failover' in another proxmox to avoid any loss, which by the way should be unlikely... i dont know... im talking about a total ignorance of systems or lack of another things knoledge's ---------------------------------------------------------------------- atliensarereal · 2023-11-29 22:18 how many people are using your services? the i/o usage is very low for me, since it's like 6 people at absolute peak load. ---------------------------------------------------------------------- roycorderov · 2023-11-29 22:36 just 3, but I have my wordpress pages that I always run advertising campaigns and they receive high traffic but they have never given me problems ---------------------------------------------------------------------- atliensarereal · 2023-11-29 22:47 i'm sure a singular host would be fine, but maybe worth considering that if there is a problem with one of the services, or with the database host, or if there is a sql injection or similar attack (which wordpress is sorta infamous for), then you would have downtime for all apps using that same database host (if you had to take it down). not something that is a problem for me, but maybe for you it'd be worth still segregating essential services from non-essential and having two db hosts? ---------------------------------------------------------------------- dazchad · 2023-11-29 22:47 I also have a single db instance for all my services. The major caveats with this solution is that the services use the same vendor and are compatible with the version. Other than that, can’t go wrong. Just remember to keep backups in check since having a single db instance makes it a single point of failure. ---------------------------------------------------------------------- et-fraxor · 2023-11-29 23:15 I would bind one db to a service. Just because the advantage of dockers portability and flexibility. If you want to remove a service delete the db container. Else… go in the db and drop it. If you want to move some services, dump db and import it to the other location… ---------------------------------------------------------------------- roycorderov · 2023-11-29 23:15 >I also have a single db instance for all my services. The major caveats with this solution is that the services use the same vendor and are compatible with the version. Other than that, can’t go wrong. Just remember to keep backups in check since having a single db instance makes it a single point of failure. ok thanks i will look for a good "how to" to start to work in that ---------------------------------------------------------------------- roycorderov · 2023-11-29 23:18 aaa I understand... good advice I will keep it in mind ---------------------------------------------------------------------- thekrautboy · 2023-11-29 23:18 A followup to [your last "discution"](https://www.reddit.com/r/selfhos ted/comments/17zuiyp/which_you_think_could_be_the_best_practices_for_a /)? ---------------------------------------------------------------------- roycorderov · 2023-11-29 23:20 aaa You're right... good point, I'll consider it, thank you. ---------------------------------------------------------------------- AdmiralPoopyDiaper · 2023-11-30 00:02 For containers, you could (if you wanted) give each it’s own DB container, and put all the volume mounts for those in the same spot to make backups easy. For VMs, you could create one DB VM and expose it to each other VM. The neat part is you can actually mix & match these strategies as you see fit. For example, I am rebuilding my homelab right now and I plan on creating a dedicated VM for each DB I need (e.g. I will create one Postgres VM. If one or more services need MySQL I will create just one of those. Etc) ---------------------------------------------------------------------- roycorderov · 2023-11-30 17:09 yes i was thinking about that create a lxc/vm with mariadb and another with postgres for each service i use one or the other i was told the galley service, i have learned a lot and now i will evaluate each one and see which one i will adopt.