The cloud is a real, physical thing
A server is just a computer that runs programs for other computers. It has the same parts as your laptop: processors (CPUs), working memory (RAM), and disk storage. The difference is the job. Your laptop serves you. A server serves requests that arrive over a network, like loading a web page or saving a file.
You already know Docker, so you have run a web app on your own machine. To let the whole internet use that app, the container needs to run on a computer that is always on, always connected, and reachable at a stable address. That computer is a server, and it lives in a data center: a warehouse full of server racks with industrial power, cooling, and very fast internet.
The cloud means renting slices of those computers by the hour instead of buying your own. AWS (Amazon Web Services) is the biggest company that rents them.
Reading a server's spec sheet
A server is described by a handful of numbers. This script prints the spec sheet of a small rented server.
Bash is used throughout this course as a calculator and simulator, since real AWS needs an account and a credit card.
cpu=2 ram_gb=4 disk_gb=50 echo "This server has $cpu vCPUs, $ram_gb GB RAM, $disk_gb GB disk"
Output
This server has 2 vCPUs, 4 GB RAM, 50 GB disk
Those three numbers are the vocabulary of every server rental page you will ever read. When AWS lists an instance as t3.medium, it is naming a fixed combination of exactly these values, and the hourly price follows from them.
What "renting" buys you
When you rent a server from AWS you get a slice of a machine in one of their data centers. You choose the size (how many vCPUs, how much RAM), AWS gives you an address, and you pay per hour or per second only while it runs.
A vCPU is a virtual CPU: one scheduled share of a physical processor core. The v matters. AWS splits one huge physical machine into many isolated virtual ones, which is how they can rent you a slice as small as 2 vCPUs. We will look at how that works in unit 3.
The key mental model for this whole course: every AWS service is a rented computer, a rented disk, or a rented network, with staff and software you did not have to hire or write.
What the cloud adds to a container that already works
A cloud server is always on, always connected, and has a stable public address, and those are the three things your laptop lacks.
The container itself is identical. The same image, the same processes, the same behaviour. What you are renting is the environment around it: a machine that never sleeps, sits on data-center internet with enormous bandwidth, and keeps a stable address so the rest of the world can find it.
Your laptop fails all three tests. It closes its lid and stops serving, it changes networks when you move between home and a café, and it hides behind a home router that gives it a private address no outside computer can reach.
Describing a larger server, with its price
This version describes 8 vCPUs, 32 GB of RAM, and a 200 GB disk, then prints what it costs per month.
cpu=8 ram_gb=32 disk_gb=200 monthly_cost=120 echo "This server has $cpu vCPUs, $ram_gb GB RAM, $disk_gb GB disk" echo "It rents for \$$monthly_cost per month"
Output
This server has 8 vCPUs, 32 GB RAM, 200 GB disk It rents for $120 per month
Reading the script
- Only the four variables at the top change from the previous version, plus one additional
echoline. The structure is the same, which is the point of naming values instead of writing them inline. - A literal dollar sign inside double quotes must be escaped as
\$, which is why the cost line reads\$$monthly_cost. The first$is escaped and prints, the second one expands the variable. - Four times the CPU and eight times the RAM of the previous server, for a cost that is roughly proportional. Cloud pricing is close to linear in the resources you ask for, which makes capacity planning mostly arithmetic.