I am working on a webapp, that needs this environment setup:<p>-------------------------------------<p>Public Routes:<p>- API (nodejs / 1+ instances)<p>- WebSockets (nodejs / 1+ instances)<p>- Object Storage (proxy)<p>Private Routes:<p>- Redis (docker / cluster)<p>- RabbitMQ (docker / cluster)<p>- MySQL (standalone / cluster)<p>Hidden (connects to Public/Private routes):<p>- worker1 (nodejs)<p>- worker2 (nodejs)<p>- worker3 (nodejs)<p>-------------------------------------<p>In researching environments for hosting, I found 3 options:<p>1) VPS/Docker for each service<p>2) All services in a single Bare metal server<p>3) Kubernetes<p>There are downsides to each. But, looking at costs, bare metal server would be the most economical, and Kubernetes is way outside my budget.<p>My budget is roughly $100, and my time is just as limited.<p>The webapp is scale ready, but that's not very important if I have no users on launch day.<p>What environment recommendations do you have that would let me run such a configuration for my webapp?
Packaging your applications as docker images from the beginning requires little extra effort, but gives you a number of deployment options and if you grow it will be easy to move to eg. k8s.<p>Setup your servers using ansible, puppet or similar to lower the requirements for redundancy and backups (if you cant take a little downtime in case of accident)<p>If you're Europe based, one suggestion is to get two ~$50 servers from Hetzner and run all services in plain docker. (i.e. two servers for redundancy)<p>Depending on your setup and requirements, it might even be enough to have one server + a cheap CDN and in that case you might even be able to run the server at home or a friends office.
If you add up the cpu/memory requirements for redis, rabbitmq, mysql etc., that itself adds up to a beefy machine. Then the network traffic from the users.<p>Better to package/run these as docker components on 2 beefy VM's w/ a LB from a provider like DigitalOcean, Vultr, Linode or Hetzner. You can pick up AWS etc, but be mindful of all the costs that add up.<p>Kubernetes is a no-no unless you have some level of proficiency in kubernetes, or are willing to invest the time.
This is quite a bit of infrastructure for an app that hasn't launched yet. If it's not too late, consider simplifying by removing RabbitMQ or Redis. Perhaps even getting rid of both, and only using MySQL. Maybe your workers could become cron-jobs or threads.<p>For hosting, consider Heroku and Heroku add-ons for MySQL, Redis, and RabbitMQ. You could run workers in Heroku as well.<p>It would be possible to run this entirely in a VPS as well and fairly straightforward. I've also had success running the web app (with postgres and redis) in Heroku but the workers on a VPS.