I would like to deploy a simple web app on DO. Droplet one: the DB; droplet 2: two containers (go web server and nginx).
I stumbled upon many topics I haven't dealt with before:
- private networks (the DB droplet should not be exposed to the whole internet. This also means that my webserver should live inside this private subnet (because the webserver is the only one that can talk to the DB))
- gateways (I would need a droplet that acts as "gateway" so that the internet can talk to my webserver through nginx)
- iptables and firewalls. I know what they mean, but I've never set them up
- simulate the previous setup locally (e.g., using vagrant and virtualbox)
I have read books like Computer Networks by Tanenbaum and TCP/IP Illustrated Vol. 1 by Stevens. While these two books are really good they really don't help me to understand tutorials regarding the points I stated before.
The first book is very theoretical and gives you a good background; the latter is a bit more practical... it's nice to know about frame formats and TCP handshakes, but none of these helps me with more practical things like: a) it's better to put my database in a private subnet (I guess know it seems obvious, but it wasn't before I read about it on a tutorial), b) the private subnet would need some sort of gateway (I know what a gateway is... It just wasn't obvious that I would need one), c) the way the gateway should be set up, d) how to abstract cloud providers specifics and setup a similar topology locally in my laptop.
Do you know which resources I can read so that I feel more comfortable dealing with networking and infrastructure when it comes to put stuff in production?