CapRover looks really neat. I like the simplicity of it compared to Portainer for example. And it seems to do much better at the most common cases, for example the nginx proxying and let's encrypt integration. :+1:
I have a question however about "best practice" or the trade-offs of running multiple apps with multiple databases. For example, the wordpress template would install a wordpress instance + MySql DB. So if I have, let's say, 10 wordpress sites, I will also have 10 instances of MySql. I guess docker makes this easier, but I wonder about the performance trade-offs. Would it be better to have one MySql instance, with multiple databases/users, and all Wordpress instances would connect to this one MySql instance?
I'm curious to hear what people do / recommend in this case.
It depends on your applications. MySQL has a relatively high idle RAM usage. So even if you have one visitor per day for your wordpress website, you'll consume ~70MB of RAM for your MySQL. So for low traffic websites, the utilization is better when you share a database. Keep in mind that sharing a database across multiple wordpress website is a relatively complex task - compared to one-click apps and you need to have a basic understanding of Docker and WordPress in order to build such a setup.
Anyways, on the other hand, for higher traffic websites, you want to have a separate database to ensure higher throughput.
I am not an expert in the field, so take this with a grain of salt. I think you'll get a more detailed response if you post this question on StackOverflow or ServerFault - they are more suitable for these generic questions. If you do so, please link your question here so other people can have reference to it as well.
Thanks @githubsaturn. I think your analysis is pretty accurate. If there are lots of small apps, then having each app with its own DB is probably an overkill... The question then is how to avoid this or work around it, especially with one-click-apps ... I was wondering if there's a way to configure one-click-apps in a way that lets you choose which existing app (usually database) to connect to, rather than create one? Or a one-click app that configures an existing database engine and add a database instance, user to it? I know it's a lot to ask, and it's far from simple ... But I still think it's an interesting challenge (hopefully).
CapRover supports custom one-click app templates. You can create a custom one-click app for wordpress that connects to an existing DB rather than creating a new one.
But this won't be part of the standard one-click app on CapRover by default. The reason is that, first of all, this is app-specific. It's only for WordPress. Other apps, may or may not support this feature. Secondly, even for WordPress, this is a fairly advanced process. Sharing a DB instance might break some specific plugins and etc.
So, although an advanced user is free to choose their adventure, the built-in one click apps should cover the most common use cases to avoid confusion and to ensure maximum stability.
I don't think it's advanced for Wordpress or other apps. It's actually quite common to share one database engine and create multiple databases on the same engine.
But I think it makes sense for CapRover to keep things simple. 馃憤
@gingerlime did you progress any further with your configuration?
Sorry, but I didn't. I switched to using docker-compose. You can read more about it on my blog post at https://blog.gingerlime.com/2019/hosting-compose-or-the-sad-buyout-of-webfaction/