Mysql Server on openhabian or?

Hello guys…
I’m setting up a new OpenHabian system on a VMware server…
what would you guys prefer with MySQL Server? Simply install it on the OpenHabian instance - or create a new Ubuntu instance and use that for the sql server?

Do you want to use it only for openHAB? If so, just install it local on the openHAB VM.

If you want to use the MySQL/mariaDB server for other things then a separation can be useful but is also optional and not needed.

Although I am using InfluxDB with Grafana instead of mariaDB.

1 Like

As Elias indicates, you don’t really provide enough information to decide between the two approaches. And there really isn’t any “correct” answer. you need to decide if the extra costs that come with running a separate VM (another machine to keep up to date, consumes more RAM and CPU, etc) is worth the benefits that you gain by running the database on a separate VM.

Personally, I opted for fewer VMs and use Docker to provide isolation between the services themselves. So I have one home automation VM that has OH, InfluxDB, Grafana, Mosquitto, and Shinobi installed as Docker containers. Then I similarly have a NAS VM, media VM, virtual desktop, and Nightscout VM which each have their own services running isolated from each other using Docker containers. If I were to separate every service I run into a separate VM, I’d need something like 20 VMs.

1 Like

Yes ok i see… that makes sense to me… So basically you would prefer the Docker solution - since that can be ran multiple containers into one OS - which acts a bit like a “vm” inside the host OS - am i right?

Sort of. Docker containers on the same OS can also have a sort of virtual network to communicate between Docker containers but within the host OS.

Thinking about containers like a “VM” isn’t really correct and it is strongly discouraged by people who work with containers a lot. Containers all share the same OS kernel and there isn’t a hardware virtualization layer like one has with a VM.

What a container is is a way to bundle an application along with all the other software and libraries it needs to run into one package. When it’s run, by default, the only thing that package has access to is the operating system’s kernel. You then get to define what other resources the container has access to such as folders on your host, access to networking, access to devices, etc. This gives you strong isolation without the extra resources required to run a VM. But it also means that the creation and use of containers has pretty much nothing in common with the creation and management of VMs.