Review 1

You'll learn
  • What it means that your app is in the cloud.

It's time to take an elevator up into the cloud! In this section I'd like to show you how the app you have so far fits into the rest of the cloud. What's happening is both simple (for you) and quite complex (behind the scenes). So start the elevator music below, and let's go up for an overview.

Elevator music button

The app you have so far is fairly simple. There's an HTTP server, with a handler for the front page and for the health check. It's put into a Docker container and deployed to AWS Lightsail.

What's happening in the cloud is quite cool. I've put together a video to explain:

To summarize, what's happening behind the scenes, in the cloud, is this:

  • The load balancer handles incoming requests, and balances them between app containers, sending about equal traffic to each.
  • If an app container fails (maybe because the harddrive crashes, a network cable is cut, or a machine is on fire 🔥), the load balancer notices via the health check, and stops routing requests to that app container.
  • If you are getting more traffic, you can scale your app vertically by adding more power to each container, or horizontally by adding more containers.

What's not mentioned in the video is that the load balancer also handles encryption to the browser (what's known as TLS), so what's going on stays secret between your app and the user.

Also, app containers are distributed over so-called availability zones (AZs). You can think of AZs as separate datacenters next to each other, with separate power supply, internet connectivity etc. They are designed in a way that if one goes down for whatever reason, the others stay up. This all means that if you add multiple app containers to your web app, you can be quite sure that your app is always available, even when some of them go down. Neat!

That was a short overview of your app in the cloud. Next up is adding our first real app functionality.

The music is licensed from Kevin MacLeod, the elevator sound is licensed from Trautwein, both under a Creative Commons By 3.0 license.

Review questions

Sign up or log in to get review questions with teacher feedback by email! 📧

Questions?

Get help at support@golang.dk.