Docker in Wappler and Managed Databases

Regarding my previous post in this thread, I contacted Digital Ocean to find out if their Managed Database offering included managing a database that exists inside a Docker container since Wappler’s Docker target tool creates a database inside the Docker container.

Here is Digital Ocean’s reply…

I’m not sure why a particular database would need to run inside a Docker container since the largest concern will be the connection string that you pass to the app that you are using. In any case, we’re unable to take over managing your own self-deployed databases. For use of our Managed Database offering, you’ll need to deploy the resource from our services.

Is it possible (or ideal) for a Wappler created Docker container to use a database other than the database that lives inside the container? If so, how would I go about setting it up in Wappler?

Thanks!

With Wappler and it’s Server Connect, you can connect to any database, no matter internal or external (managed) to the web server.

So if you are using Docker for hosting and don’t want to use the supplied Docker database that is installed next to your web server, you can just select to not use it.

And then when making database connection just enter the remote (managed) database info.

Just make sure you really need an external, managed database, as usually that is a bit of an overkill.
You will be paying much more and you are probably getting a shared database server. Which is also slower to connect to as it is remote to your web server.

Usually just as with any hosting you want to keep your database close to the web server and as exclusive as possible for the fastest connections. So that is why, specially when running docker it is much better to have both the web server and database server running on the same VPS instance/Docker Machine.

3 Likes

Understood, @George…thank you for clearing that up for me.

I’ll start with running everything on the same VPS instance as you suggest and only move to an external, managed db if I ever have a good reason to.

I’m a little confused about one thing though. You mention that the web server and database are running on the same VPS Instance/Docker Machine, but when I look at my local Docker stuff in Portainer I see that my server and database seem to be in two different Docker containers…

I’m assuming that even though they live in two different containers, the fact that those two containers live on the same VPS is a speed advantage over having the database hosted outside the VPS. Is that correct?

PS…thanks for the Portainer recommendation. It’s pretty cool as a visual / GUI tool for Docker!

Yes each Docker service is isolated in its own container. That is the beauty of it. Each works separately at full power and in its own environment so their don’t effect each other.

Those containers do have direct local network connections so or supper fast in connecting.
And you can have as many running on the same VPS as you want.

With Portainer you can indeed nicely monitor them as well.
And with the Digital Oceans droplet admin you can monitor the whole droplet/VPS server running capacity and resources usage.

2 Likes