Chapter 2 · Part 1: Cloud and AWS Foundations
Cloud Computing from Scratch
Goal: build a rock-solid mental model of what "the cloud" is, how it is physically built, and what IaaS, CaaS, PaaS, serverless (FaaS) and SaaS really mean, with real products as examples, so you never have to look these words up again.
Reading time: about 60 minutes. Lab time: 20 minutes, on paper, no AWS account and no cost.
How to read this chapter: read it top to bottom once. Boxes marked Go Deeper are collapsed and optional. Every idea has an everyday analogy first, then the technical truth, then a real example.
Version note: facts about AWS services were checked against AWS documentation in December 2026. Prices in this chapter are made-up round numbers for teaching. Real prices are on the AWS pricing pages.
What You Will Be Able to Do After This Chapter#
- Explain cloud computing to a non-technical friend in two minutes, without using jargon.
- Say how a cloud provider physically turns one big machine into many small rentable ones.
- Place any product (Gmail, EC2, Lambda, RDS, Heroku, Salesforce and so on) on the IaaS, CaaS, PaaS, serverless or SaaS ladder, and state exactly who manages what.
- Tell public, private, hybrid, multi-cloud, edge and sovereign cloud apart, with an example of who uses each and why.
- Name the six advantages of cloud computing and prove at least one with arithmetic.
- Use the words scalability, elasticity, availability, durability, latency and throughput correctly, and convert "nines" into minutes of downtime.
- Pick the right rung of the ladder for a new application and defend the choice.
The Big Picture: Pizza Night#
Imagine you want pizza on Friday night. You have four ways to get it, and they match the cloud service models almost perfectly.
| Pizza option | What you do | What someone else does | Cloud name | Real example |
|---|---|---|---|---|
| 1. Make it at home | Everything: buy flour, own the oven, make dough, cook, clean up | Nothing | On-premises (your own data center) | A company with its own server room |
| 2. Rent a kitchen | Bring ingredients, follow your recipe, cook, wash up | Building, oven, gas, water, electricity | IaaS (Infrastructure as a Service) | Amazon EC2, Google Compute Engine, Azure Virtual Machines |
| 3. Ready-made dough and sauce, delivered | Add your toppings and bake | Dough, sauce, a ready oven, cleaning | PaaS (Platform as a Service) | AWS Elastic Beanstalk, Heroku, Google App Engine |
| 4. Order and eat at a restaurant | Choose the pizza and eat it | Everything else | SaaS (Software as a Service) | Gmail, Salesforce, Zoom, Microsoft 365 |
Going down the table, you do less work, and you also control less. That single trade-off explains the whole chapter. A fifth option, serverless, is like a pizza vending machine that cooks one slice only when someone pays, and charges for that slice only. We meet it properly in section 2.7.
The whole chapter in 60 seconds: the cloud is renting computing power over the internet, on demand, and paying only for what you use. A provider such as AWS owns huge data centers, slices the hardware into small virtual pieces, and lets you rent them in seconds through an API. How much you manage yourself depends on the rung you pick. IaaS: you get raw servers, disks and networks (you manage the OS and up). PaaS: you give your code, the platform runs it. Serverless (FaaS): you give a function, it runs only on demand and scales to zero. SaaS: you just use the finished software. The more the provider manages, the less you control and the less you operate. Architects pick the highest rung that still meets the requirements: buy before build, managed before self-managed, serverless before servers.
Jargon Buster#
| Term | Plain meaning |
|---|---|
| Server | A computer that answers requests from other computers (a web page, a database query). Often a powerful machine in a rack, without a screen. |
| Data center | A secure building full of servers, storage and network equipment, with its own power, cooling and security. |
| Virtualization | Splitting one physical machine into several isolated "virtual" machines, so many customers can safely share it. |
| Hypervisor | The software (or chip-assisted layer) that does the splitting and keeps the pieces apart. |
| Virtual machine (VM) | A pretend computer, with its own operating system, running on a real one. An EC2 instance is a VM. |
| Container | A lightweight package that holds an app and everything it needs. It shares the host's operating system kernel, so it starts in seconds. |
| Operating system (OS) | The base software of a computer (Linux, Windows) that manages hardware and runs programs. |
| Runtime | The engine that runs your code: Node.js, Python, the Java Virtual Machine. |
| Middleware | Software between the OS and your app: web servers (Nginx), app servers, message brokers. |
| API | A defined way for one program to ask another program to do something. In the cloud, everything is an API call, even "create a server". |
| Provisioning | Getting a resource ready for use (creating a server, a disk, a network). |
| Multi-tenancy | Many customers ("tenants") share the same physical hardware while staying isolated from each other. |
| Capex | Capital expense: a big upfront purchase you own (buying servers). |
| Opex | Operating expense: a pay-as-you-go cost (a monthly bill for what you used). |
| Managed service | A service where the provider handles the boring operations (patching, backups, scaling) for you. |
| Cloud-native | Designed from the start to use cloud strengths: elastic, automated, built from managed services. |
More vocabulary (scalability, elasticity, availability, durability, latency, throughput) comes in section 2.10, once you have the picture.
2.1 Life Before the Cloud: One Company and Its Server Room#
To appreciate the cloud, live without it for one minute. Meet StackCafe, the coffee-ordering startup that follows you through this course. It is 2008. Maya, the founder, wants an ordering website for her coffee shops. Here is what she must do.
| Step | What happens in the old world | Time and money |
|---|---|---|
| 1. Guess the future | "How many customers will we have in two years?" Nobody knows, but she must decide now. | A guess that is almost always wrong |
| 2. Buy hardware | Order servers, storage, network switches, a firewall, a backup tape drive. Pay upfront. | Thousands of dollars, 4 to 12 weeks of delivery |
| 3. Build a room | A cool room with backup power (a UPS and a generator), air conditioning, locks, fire suppression, and an internet line from two providers for safety. | More money, more weeks |
| 4. Install and configure | Rack the servers, cable them, install the operating system, set up networking. | Days to weeks |
| 5. Hire people | Someone must patch, monitor, replace failed disks and answer the phone at 3 a.m. | Salaries, forever |
| 6. Live with the consequences | Too little capacity on a busy Monday: the site crashes. Too much capacity on a quiet Tuesday: expensive machines sit idle. | Lost sales or wasted money, every day |
Studies of traditional data centers regularly found that servers ran at only a small fraction of their capacity, because companies had to buy for their busiest moment and then pay for the machines all year. One more problem: if the building floods, loses power or catches fire, the website disappears, because there is only one building.
OLD WORLD (own servers) CLOUD WORLD
Guess capacity ---> Buy ---> Wait weeks Click or call an API ---> Server ready in seconds
Pay upfront for peak Pay per second for what you actually use
One building, one point of failure Many buildings in many places
You hire staff to run it The provider runs the building and hardwareThe cloud answers each pain point. Let us see how.
2.2 What Cloud Computing Really Is#
Cloud computing is renting IT resources (servers, storage, databases, networks, software, AI models) from a provider over the internet, getting them in minutes, and paying only for what you use.
The US standards body NIST gives the classic definition with five essential traits. If a service lacks these, it is not really "cloud", only hosting with a nicer name.
| Trait | Plain meaning | How you see it on AWS |
|---|---|---|
| On-demand self-service | You get resources yourself, instantly, without calling a salesperson | Click "Launch instance" or run one CLI command. The server is ready in about a minute |
| Broad network access | You reach it over the network from any device | Console in a browser, CLI on a laptop, SDK in a program |
| Resource pooling | The provider shares a huge pool of hardware among many customers (multi-tenancy) and hands out slices | Your EC2 instance sits on a physical host that may also serve other customers, yet is isolated from them |
| Rapid elasticity | Capacity grows and shrinks quickly, often automatically | Auto Scaling adds servers at 8 a.m. and removes them at noon |
| Measured service | Usage is metered, so you pay for what you consume | Billed per second, per request, per GB-month. Cost Explorer shows the details |
How a cloud is physically built#
The magic is not magic. It is three layers stacked on top of each other.
YOU (console, CLI, SDK)
| "Please create a server with 2 CPUs and 4 GB" <- an API call over HTTPS
v
+--------------------------------------------------------------+
| 3. CONTROL PLANE (the cloud's brain) |
| checks who you are, finds a free host, creates the VM, |
| attaches network + disk, starts the meter |
+--------------------------------------------------------------+
| 2. VIRTUALIZATION (the slicer) |
| One physical server -> many isolated virtual machines |
| |
| +------ one physical host in a rack ----------------------+ |
| | VM A (you) VM B (customer X) VM C (customer Y) | |
| | [ hypervisor / Nitro: keeps them apart ] | |
| | [ real CPUs, memory, disks, network card ] | |
| +---------------------------------------------------------+ |
+--------------------------------------------------------------+
| 1. PHYSICAL (data centers) |
| Thousands of racks, power, cooling, fibers, guards |
+--------------------------------------------------------------+- Physical layer. Massive buildings with racks of servers, storage devices and network gear, plus power, cooling and security. You never see them. Chapter 3 goes inside.
- Virtualization layer. A hypervisor splits each physical server into many virtual machines. Each VM believes it owns a real computer, but memory and CPU are walled off from the others. This is how one machine serves many customers safely.
- Control plane. Software that receives your request, checks your permissions (IAM, Chapter 6), picks a host with room, creates the VM and starts billing. Because creating a server is just software, it takes seconds instead of weeks.
Why renting is cheaper: a provider that buys millions of servers pays lower prices than you could, runs its data centers at high utilization because many customers share them, and spreads the cost of operations over everyone. This is called economies of scale, and it is why AWS can lower prices over time.
Go DeeperWhat actually happens in the 60 seconds after you click Launch Instance
- Authentication and authorization. Your request carries a signature. AWS checks who you are and whether your IAM policy allows launching an instance.
- Validation. Does your account have quota left? Is the instance type available in this Availability Zone? Is the image (AMI) valid?
- Placement. A scheduler picks a physical host with free CPU and memory, in the Availability Zone you chose.
- Resource creation. A virtual network interface is attached in your VPC, a virtual disk (EBS volume) is created from the image, and security group rules are applied.
- Boot. The VM starts. The operating system boots from the disk, and the instance gets its private IP address.
- Billing starts. The meter runs per second while the instance is in the running state.
Steps 1 to 4 are the control plane at work. Your running instance, doing real work, is the data plane. This split matters later: when a provider has an outage in the control plane, running servers often keep working while you cannot create new ones.
Go DeeperVM vs. container vs. microVM: three ways to slice a machine
| Virtual machine | Container | MicroVM | |
|---|---|---|---|
| What is isolated | A full computer with its own OS and kernel | A process group that shares the host kernel | A tiny VM with a minimal kernel |
| Start time | Tens of seconds | A second or less | Fractions of a second |
| Isolation strength | Very strong (hardware-assisted) | Good, but a shared kernel is a bigger surface | Very strong, like a VM |
| AWS example | Amazon EC2 | Amazon ECS and EKS | AWS Lambda and Fargate use Firecracker microVMs under the hood |
You do not need to run any of these yet. The point: AWS picks the slicing technique that gives each service the right mix of speed and security.
2.3 The Responsibility Ladder: Who Manages What#
Every application is a stack of layers. From the bottom: a building, network cables, hardware, a virtualization layer, an operating system, a runtime, your code, and finally your data and users. The service models are simply different answers to one question: "Up to which layer does the provider look after things for me?"
| Layer (top = closest to the user) | On-premises | IaaS | CaaS (Fargate) | PaaS | Serverless (FaaS) | SaaS |
|---|---|---|---|---|---|---|
| Your users, access and data | YOU | YOU | YOU | YOU | YOU | YOU |
| Application features and settings | YOU | YOU | YOU | YOU | YOU | provider (you only configure) |
| Your application code | YOU | YOU | YOU (in a container image) | YOU | YOU (just a function) | provider |
| Runtime (Node.js, Python, Java) | YOU | YOU | YOU (inside the image) | provider | provider | provider |
| Middleware (web server, orchestrator) | YOU | YOU | provider (orchestration) | provider | provider | provider |
| Operating system | YOU | YOU | provider | provider | provider | provider |
| Virtualization | YOU | provider | provider | provider | provider | provider |
| Servers (hardware) | YOU | provider | provider | provider | provider | provider |
| Storage and network hardware | YOU | provider | provider | provider | provider | provider |
| Data center building, power, cooling | YOU | provider | provider | provider | provider | provider |
Read the table in columns. In the on-premises column, everything is YOU. Move right and the provider's share grows from the bottom up. In the SaaS column you only manage who may log in and what data you put in.
YOU MANAGE ^ | PROVIDER MANAGES
|
On-prem | [ app ][ data ][ runtime ][ OS ][ servers ][ network ][ building ] all yours
IaaS | [ app ][ data ][ runtime ][ OS ] | servers, network, building
CaaS | [ app ][ data ][ container image ] | OS, servers, network, building
PaaS | [ app ][ data ] | runtime, OS, servers, network, building
Serverless | [ function ][ data ] | everything underneath, scaling too
SaaS | [ data + users + settings ] | the whole application and underneath
MORE CONTROL, MORE WORK <------------------------------> LESS CONTROL, LESS WORKThe one test that never fails: to place a service on the ladder, ask "Who patches the operating system?" If you do, it is IaaS. If the provider does, and you still deploy your own code, it is PaaS, CaaS or serverless. If you do not deploy any code at all, it is SaaS.
Your data and your access settings are always yours. Even on SaaS, the provider does not decide who in your company may open which file, and does not make your passwords strong. This is the idea behind the shared responsibility model, which Chapter 3 covers for AWS in detail.
The trade-off in one table#
| On-prem / IaaS | CaaS | PaaS | Serverless | SaaS | |
|---|---|---|---|---|---|
| Control and flexibility | Highest | High | Medium | Lower | Lowest |
| Operations work for you | Highest | Medium | Low | Very low | Almost none |
| Time to get started | Hours to days | Hours | Minutes to hours | Minutes | Minutes |
| Cost pattern | Pay while it runs, even idle | Pay while tasks run | Pay while it runs | Pay per request or per millisecond | Per user per month, usually |
| Risk of lock-in | Low | Low to medium | Medium | Medium to high | High |
2.4 IaaS in Depth: Renting the Raw Materials#
Analogy: renting an empty flat. The landlord gives you walls, plumbing and electricity. You bring the furniture, decide the layout, fix what breaks inside, and keep it clean. You have total freedom, and total responsibility for everything inside the door.
Infrastructure as a Service (IaaS) gives you the basic building blocks of computing as rentable pieces: virtual servers, storage disks, and virtual networks. You choose the operating system and everything above it.
| IaaS building block | What it is | AWS service | Same idea elsewhere |
|---|---|---|---|
| Virtual server | A computer you can start, stop and resize | Amazon EC2 | Azure Virtual Machines, Google Compute Engine, DigitalOcean Droplets |
| Block disk | A virtual hard drive attached to a server | Amazon EBS | Azure Managed Disks, Google Persistent Disk |
| Virtual private network | Your own isolated network with IP ranges and firewalls | Amazon VPC | Azure Virtual Network, Google VPC |
| Load balancer | Spreads traffic over many servers | Elastic Load Balancing | Azure Load Balancer, Google Cloud Load Balancing |
What you do on IaaS#
- Choose the size of the server (CPU, memory) and the operating system (Amazon Linux, Ubuntu, Windows Server).
- Patch and update the operating system, regularly.
- Install your runtime and web server, and deploy your code.
- Set up scaling and backups (the building blocks exist, but you wire them together).
- Secure it: firewall rules, user accounts, disk encryption, antivirus where needed.
A worked example: StackCafe v1 on IaaS#
Maya launches one EC2 server, installs the web server and the database on it, and points her domain at it. The commands below are only for reading now. You will run real ones in Chapter 15.
# 1. Ask AWS for one small Linux server (the control plane creates a VM)
aws ec2 run-instances \
--image-id ami-0123456789abcdef0 \
--instance-type t3.small \
--count 1
# 2. Log in and install what the app needs (YOUR job on IaaS)
sudo dnf update -y # patch the operating system
sudo dnf install -y nginx # install a web server
sudo systemctl enable --now nginxNotice that AWS gave her the machine, and everything after that first command is her work. If a security patch for Linux appears, she must apply it.
When IaaS is the right rung#
| Choose IaaS when | Example |
|---|---|
| You need full control of the OS or special software | A licensed application that needs specific kernel settings |
| You are moving an existing application without changing it ("lift and shift") | A company moves its 200 virtual machines from its own data center |
| The workload is unusual | GPUs for training, very large memory machines, custom network appliances |
| You must run software that no managed service offers | A niche database engine |
IaaS cost pattern: you pay for a server every second it is running, even when nobody uses it. A forgotten test server keeps billing. Stopping or deleting what you do not need is a habit to build from day one (Chapter 4).
2.5 PaaS in Depth: Bring Code, Not Servers#
Analogy: renting a furnished apartment. The furniture, the heating and the cleaning service are included. You move in with your suitcase (your code) and start living. You cannot knock down walls, but you also never fix a leaking pipe.
Platform as a Service (PaaS) hands you a ready platform to run your application. You upload code. The platform provides the operating system, runtime, web server, patching, load balancing and often auto scaling.
| PaaS example | What you give it | What it does for you |
|---|---|---|
| AWS Elastic Beanstalk | A zip of your Node.js, Python, Java, .NET, PHP, Ruby or Go app | Creates servers, load balancer and scaling, then deploys and monitors your app |
| AWS App Runner | A container image or a source repository | Builds, deploys, scales and gives you an HTTPS URL |
| Amazon RDS | "I want a PostgreSQL database" | Installs and patches the engine, takes backups, offers a standby copy for failures |
| Heroku | git push | Builds and runs the app on managed containers |
| Google App Engine, Azure App Service | Your code | The same idea on other clouds |
The honest truth: the lines are blurry#
Industry diagrams make the boundaries look sharp. Real products sit on a spectrum. Amazon RDS is a good example. Is it IaaS or PaaS? You never log in to its operating system, and AWS patches the database engine, so it behaves like PaaS. People often call it a managed service. Do not memorize labels for every service. Use the test from section 2.3: who patches the OS, and what do I deploy?
| Running a database two ways | MySQL installed on an EC2 server (IaaS) | Amazon RDS for MySQL (PaaS-like) |
|---|---|---|
| OS patching | You | AWS |
| Database engine upgrades | You | AWS applies them in a maintenance window you choose |
| Backups | You write and test the scripts | Automated backups and point-in-time recovery |
| A second copy for failures | You build and operate replication | Tick "Multi-AZ" (Chapter 24) |
| Control over OS and config | Total | Limited to what RDS exposes |
Rule of thumb: if a managed service meets your needs, use it. The hours you do not spend patching and babysitting are worth more than the extra control you will probably never use.
Trade-offs of PaaS#
- Constraints: only certain languages or versions, certain ways of storing files, and limits on background processes.
- Less visibility: when something is slow, you cannot always look inside the machine.
- Lock-in: moving away may mean changing how your app is packaged. Containers reduce this risk.
2.6 SaaS in Depth: Just Use the Software#
Analogy: a restaurant. You do not shop, cook or wash dishes. You choose from the menu and eat. If the food is not quite how you like it, you can only adjust small things, such as "no onions".
Software as a Service (SaaS) is a complete application you use over the internet, usually in a browser or an app, normally paid per user per month. The provider runs, updates and secures the whole thing.
| Everyday SaaS | What it does | What YOU still manage |
|---|---|---|
| Gmail, Google Workspace | Email, calendar, documents | User accounts, passwords and MFA, sharing rules, what you store |
| Microsoft 365 | Office apps and email in the cloud | Licenses, user access, data policies |
| Salesforce | Customer relationship management | Your customer data, roles, custom fields |
| Zoom, Slack | Meetings and chat | Who may join, retention settings |
| Dropbox | File storage and sharing | Who can see which folder |
| GitHub | Code hosting | Repository access, secrets, branch rules |
| Amazon Connect (on AWS) | A cloud contact center for customer calls and chats | Agents, call flows, customer data |
| Amazon WorkSpaces (on AWS) | Virtual desktops reached from any device | Users, images, applications on the desktops |
Two ways SaaS matters to an architect#
- As a buyer. The cheapest system to run is the one you do not build. If a SaaS product does the job (payroll, email, ticketing), buying it is often the best architecture decision.
- As a builder. Later in the course StackCafe may sell its own ordering platform to other coffee shops. That makes StackCafe a SaaS provider, and its design problems change: many customers on one system (multi-tenancy), isolation, per-customer billing (Chapter 45).
SaaS trap: "It is SaaS, so security is the vendor's problem." No. Data leaks from SaaS usually come from customers: a public sharing link, a former employee who still has access, a weak password with no MFA. You own your users and your data.
2.7 Serverless Explained Properly (FaaS, CaaS and More)#
Analogy: the electricity grid. You do not own a power plant, you do not choose a generator size, you plug in and the meter counts kilowatt-hours. When you use nothing, you pay nothing, and when you suddenly need ten times more, the grid just supplies it.
What "serverless" really means#
Servers still exist. You just never see, size, patch or scale them. A service is serverless when it has these four properties:
| Property | Meaning |
|---|---|
| No server management | No operating system to patch, no instance to size |
| Automatic scaling | From zero to thousands of parallel executions and back, with no setup |
| Pay for use | You are billed per request, per millisecond or per GB stored, not per hour of an idle server |
| Built-in availability | The service already runs across multiple data centers for you |
FaaS: Function as a Service#
FaaS is the compute form of serverless. You write a small function, upload it, and the platform runs it only when an event happens: a file lands in a bucket, a web request arrives, a timer fires. AWS Lambda is the AWS example. You pay for each run, measured in milliseconds.
# A complete Lambda function. This is ALL the "server" code you write.
def handler(event, context):
name = event.get("name", "friend")
return {"message": f"Welcome to StackCafe, {name}!"}The serverless family on AWS#
| Need | Serverless service | What you do not manage |
|---|---|---|
| Run code | AWS Lambda (FaaS) | Servers, OS, scaling |
| Run containers | AWS Fargate with ECS or EKS (CaaS) | The servers that host the containers |
| Store files | Amazon S3 | Disks, capacity, replication |
| Store records | Amazon DynamoDB | Database servers, partitioning |
| Expose an API | Amazon API Gateway | Web servers, load balancers |
| Queue and notify | Amazon SQS, SNS, EventBridge | Brokers and their scaling |
| Orchestrate steps | AWS Step Functions | The workflow engine |
CaaS: Containers as a Service#
A container packs your app, its libraries and its settings into one portable unit that runs the same everywhere. CaaS means the provider runs the containers for you. With Amazon ECS or EKS on AWS Fargate, you give a container image and say how much CPU and memory it needs. AWS finds the machine and runs it. It sits between PaaS and serverless: more flexible than PaaS (any language, any library), with less operating work than IaaS. Chapters 18 and 19 are fully about this.
Where serverless shines, and where it does not#
| Shines | Think twice |
|---|---|
| Spiky or unpredictable traffic (a flash sale, a daily report) | Constant, heavy traffic 24 hours a day, where a fixed server can cost less |
| Event-driven work (react to an upload, a message, a schedule) | Long-running jobs. A Lambda function has a maximum run time of 15 minutes |
| Small teams with no operations staff | Software that needs special hardware or full OS access |
| Paying nothing when nobody is using the app | Very low-latency needs where an occasional "cold start" delay is not acceptable without extra tuning |
"Serverless means there are no servers." Wrong. There are servers. They are simply not your problem. If an exam or interviewer asks, say: "Serverless means no server management, automatic scaling, pay per use and built-in high availability."
Go DeeperWhere does serverless sit on the ladder? Clearing up the confusion
Some books draw serverless as a separate rung, some fold it into PaaS. Both are fine, because the ladder is a guide, not a law. What matters is the practical difference between the two:
| Classic PaaS (Elastic Beanstalk) | Serverless (Lambda) | |
|---|---|---|
| Is something always running? | Yes, at least one instance | No, code runs only when triggered |
| Scaling | Scales by adding and removing instances, within minutes | Scales per request, within seconds, and to zero |
| You pay while idle? | Yes | No |
| Unit you think in | An application and its instances | A function and its events |
2.8 Deployment Models: Where the Cloud Lives#
Service models (IaaS, PaaS, SaaS) say what you rent. Deployment models say where it runs and who shares it.
Analogy: getting around a city. You can own a car (private), use taxis and ride apps (public), own a car for daily trips and take taxis for airports (hybrid), or use several ride apps to avoid depending on one (multi-cloud).
| Model | What it is | Real example | Typical user and reason |
|---|---|---|---|
| Public cloud | A provider's shared infrastructure, rented over the internet | AWS, Microsoft Azure, Google Cloud | Startups and most enterprises. Fast start, no hardware, pay as you go |
| Private cloud | Cloud-style infrastructure used by one organization only, usually in its own data center | A bank running VMware or OpenStack on its own hardware | Organizations with strict control rules or large existing investments |
| Hybrid cloud | On-premises and public cloud connected and used together | A hospital keeps patient records on-premises and runs analytics on AWS, linked by AWS Direct Connect or VPN | Companies mid-migration, or with data that must stay in the building |
| Multi-cloud | Using more than one public cloud provider | An app on AWS with analytics in Google BigQuery | Best-of-breed services, merger leftovers, vendor-risk policies. Costs extra skills and complexity |
| Edge cloud | Cloud capacity placed close to users or machines | AWS Local Zones, AWS Wavelength, AWS Outposts, AWS Snow devices | Factories, games, video, 5G apps that need very low latency |
| Sovereign cloud | A cloud operated under a specific country's or region's legal control | The AWS European Sovereign Cloud, and AWS GovCloud (US) for US government | Governments and regulated industries with legal data and operator-residency rules |
| Community cloud | Infrastructure shared by several organizations with common needs | A shared platform for universities or government agencies | Rare in practice. Mostly an exam term |
A hybrid example you can picture#
YOUR DATA CENTER (on-premises) AWS CLOUD
+------------------------------+ private link +----------------------------+
| Old billing system |<=================>| New web and mobile app |
| Customer database | Direct Connect | Analytics and AI |
| (must stay here by law) | or VPN | Backup copies |
+------------------------------+ +----------------------------+Do not mix these up: hybrid = your own data center plus a cloud. Multi-cloud = two or more cloud providers. A company can be both. Many exam and interview answers lose points on exactly this.
Go DeeperCloud-native, lift and shift, and why the model you pick changes the bill
There are three common ways an application ends up in the cloud:
- Lift and shift (rehost). Move existing servers as they are to IaaS. Fast and low risk, but you keep most of the old operating work, and you often pay more than you need.
- Replatform. Change a few parts to use managed services, for example moving the database to RDS. A good balance.
- Cloud-native (refactor). Redesign to use serverless, containers and managed services. More effort now, and the lowest operating burden later.
Chapter 44 goes through this in detail as the "7 Rs" of migration.
2.9 The Six Advantages of Cloud Computing#
AWS summarizes the benefits in six points. Learn them. They appear in interviews, in business cases and in the Cloud Practitioner exam.
| # | Advantage | In plain words | StackCafe example |
|---|---|---|---|
| 1 | Trade fixed expense for variable expense | No big upfront purchase. You pay for what you consume | Maya spends nothing on servers before the first customer arrives |
| 2 | Benefit from massive economies of scale | Millions of customers share costs, so unit prices are lower than you could get alone | She rents storage at a price no single coffee chain could build |
| 3 | Stop guessing capacity | Scale up and down with real demand | No more buying for the Monday-morning rush |
| 4 | Increase speed and agility | New resources in minutes, so experiments are cheap | A new test environment takes minutes, not a procurement ticket |
| 5 | Stop spending money running and maintaining data centers | Focus on your product, not on racks and cooling | Her team builds the app instead of replacing disks |
| 6 | Go global in minutes | Deploy close to customers on other continents, quickly | Opening in Europe means choosing another Region, not building a new data center |
Prove advantage 3 with arithmetic#
Assume (for teaching only) that one server costs $0.10 per hour. StackCafe needs 2 servers most of the day, but 10 servers during a 4-hour morning rush. A month has 30 days.
| Approach | Server-hours per month | Cost |
|---|---|---|
| Own servers: buy for the peak, run 10 all day | 10 servers × 24 h × 30 days = 7,200 | 7,200 × $0.10 = $720 |
| Cloud: 2 always, plus 8 extra during 4 peak hours | 2 × 24 × 30 = 1,440, plus 8 × 4 × 30 = 960, total 2,400 | 2,400 × $0.10 = $240 |
| Difference | $480 saved per month, about 67 percent |
The numbers are invented, but the shape is real: the spikier your traffic, the more elasticity saves. If traffic were flat at 10 servers all day, the cloud would not save anything on this part.
Capex vs. opex in one line: capex means you pay first and use later, and the asset loses value on your books. Opex means you use first and pay later, for exactly what you used. Finance teams like opex for startups because it keeps cash free.
2.10 When the Cloud Is Not the Best Answer, and the Words Every Architect Uses#
The cloud is not always the answer#
A good architect also knows the honest exceptions.
| Situation | Why the cloud may not win | Better direction |
|---|---|---|
| Very large, perfectly steady workload, running flat out 24/7 for years | The elasticity benefit disappears, and owned hardware at high utilization can cost less | Compare with commitments such as Savings Plans, or consider hybrid |
| Machines on a factory floor need answers in a few milliseconds | The nearest Region is too far away | Edge options: AWS Outposts, Local Zones |
| Law says data must stay in a country with no AWS Region | You may not be allowed to host there | Hybrid, a local provider, or Outposts |
| The team has no cloud skills and a deadline next week | The learning curve and misconfiguration risk are real | SaaS, a managed platform, or hire help first |
The vocabulary, finally explained once#
| Word | Plain meaning | Analogy and example |
|---|---|---|
| Scalability | The ability to handle more load by adding resources | A restaurant that can add tables. Vertical (scale up) = a bigger server. Horizontal (scale out) = more servers |
| Elasticity | Scaling that follows demand automatically, both up and down | Extra waiters appear at lunch and go home after. Auto Scaling groups do this |
| Availability | The percentage of time a system works when you need it | A shop open 99.9 percent of the planned hours |
| High availability (HA) | Designed so one failure does not take the service down, maybe with a short blip | Two cashiers: if one leaves, the line moves a bit slower |
| Fault tolerance | The service keeps working with no interruption when a part fails | A plane with several engines |
| Durability | The chance that your stored data is not lost | Photos stored in several vaults. Amazon S3 is designed for 99.999999999 percent (11 nines) durability |
| Latency | The delay for one request to get an answer (milliseconds) | The time for one letter to arrive |
| Throughput | How much work is done per unit of time | How many letters per hour the post office handles |
| Bandwidth | The maximum data a connection can carry per second | The width of the road |
| SLA | A written promise from the provider about availability, with a credit if broken | A warranty |
| RTO and RPO | RTO: how long you can be down. RPO: how much recent data you can afford to lose | "Back in 1 hour" and "lose at most 5 minutes of orders" (Chapter 42) |
What the "nines" mean in real downtime#
| Availability | Downtime per year | Downtime per month (30 days) | Feels like |
|---|---|---|---|
| 99% ("two nines") | 3.65 days | 7.2 hours | Hobby project |
| 99.9% ("three nines") | 8.76 hours | 43.2 minutes | Typical business app |
| 99.99% ("four nines") | 52.6 minutes | 4.3 minutes | Important customer-facing system |
| 99.999% ("five nines") | 5.26 minutes | 26 seconds | Critical systems. Expensive to build |
Each extra nine usually costs much more, so ask the business: "What does one hour of downtime cost us?" before promising one.
Scalability is not elasticity. A system is scalable if you can add capacity. It is elastic if capacity follows demand automatically, in both directions. Also, availability is not durability: a service can be down for an hour (low availability) and still never lose a byte (high durability).
2.11 Same App, Five Ways: Hosting the StackCafe Website#
The best way to understand the ladder is to solve one problem with every rung. StackCafe wants an ordering website: customers browse the menu, place orders, and staff see them.
| Approach | How it is built | You manage | Scaling | Cost pattern | Best when |
|---|---|---|---|---|---|
| IaaS | Two EC2 servers with Nginx and the app, MySQL on its own EC2 server, a load balancer | OS, web server, runtime, patching, backups, database | You configure Auto Scaling yourself | Per hour per server, even idle | You need full control, or you are moving an old app unchanged |
| CaaS | The app in a container on ECS with Fargate, database on Amazon RDS | The container image and the app | Add or remove tasks by rule | Per vCPU and GB per second while tasks run | The team already uses containers |
| PaaS | Elastic Beanstalk or App Runner with Amazon RDS | The code and its settings | Built in | Per running instance | A small team wants to deploy code fast |
| Serverless | S3 and CloudFront for the page, API Gateway and Lambda for logic, DynamoDB for orders | The functions and the data model | Automatic, to zero | Per request and per GB | Spiky traffic, tiny team, new product |
| SaaS | Buy an online-ordering product (for example Shopify or Square Online) and configure the menu | The menu, staff users, store settings | The vendor's problem | Monthly fee, and a share per order | Selling coffee matters more than building software |
How an architect walks the ladder#
Is there a good product you can just buy? ---- yes ----> SaaS (stop here)
| no
v
Can the code run as small event-driven functions? --- yes ---> SERVERLESS (Lambda, S3, DynamoDB)
| no
v
Does a managed platform support your language and needs? -- yes --> PaaS (App Runner, Beanstalk)
| no
v
Is your app already in containers (or easy to put in)? --- yes --> CaaS (ECS or EKS on Fargate)
| no
v
Do you need full OS control, special software or a lift and shift? --> IaaS (EC2)Architect Decisions: Which Rung Should You Pick?#
| If the requirement says... | Lean towards | Why |
|---|---|---|
| "We need email, HR and CRM, and nobody wants to run them" | SaaS | Building commodity software is a waste |
| "Unpredictable traffic, small team, pay only when used" | Serverless | Scales to zero, no operations |
| "Deploy a standard web app quickly, no infrastructure work" | PaaS | Upload code, platform does the rest |
| "We use Docker and microservices" | CaaS | Containers fit, with less operating work than IaaS |
| "We need root access, a custom kernel or licensed software tied to a server" | IaaS | Only IaaS gives full control |
| "Move 300 existing servers in 3 months with no code change" | IaaS (rehost) | Fastest and least risky first step |
| "Data must stay on-premises, but we want cloud analytics" | Hybrid | Keep data local, send what is allowed |
| "Strict control by a national authority" | Sovereign cloud or private cloud | Legal and operator-residency needs |
The architect's ladder rule: buy before build, managed before self-managed, serverless before servers, servers before your own data center. Go down a rung only when a real requirement forces you to, and write down which requirement it was. "We like having control" is not a requirement.
Traps: Mistakes That Cost Marks and Money#
"RDS is IaaS." RDS is a managed database service. If you install MySQL yourself on an EC2 server, that is IaaS plus your own work. If you use RDS, AWS runs the OS and database engine for you.
"The cloud is always cheaper." It is cheaper when you use elasticity and managed services well. A lifted-and-shifted, always-on, oversized fleet can cost more than the old data center. Cost needs design (Chapters 5 and 43).
"Hybrid and multi-cloud are the same thing." Hybrid means on-premises plus cloud. Multi-cloud means more than one cloud provider.
"Serverless is always the best answer." It is the best answer for spiky, event-driven work. For steady heavy loads, long jobs or special hardware, containers or servers can be simpler and cheaper.
Security basics for every model: turn on MFA for every human account, never share passwords, give each person only the access they need, and remember that your data is always your responsibility, whichever rung you pick.
2.12 Hands-on Lab: Classify 20 Real Products#
Time: 20 minutes. Cost: $0. You need only paper, or a notes app. No AWS account is needed yet (Chapter 4 creates it).
Step 1. Place each product on the ladder#
For each product, write On-prem, IaaS, CaaS, PaaS, Serverless or SaaS, then note who patches the operating system.
- Gmail
- Amazon EC2
- AWS Lambda
- AWS Elastic Beanstalk
- Salesforce
- Amazon S3
- Amazon RDS
- MySQL you installed yourself on an EC2 server
- Dropbox
- Heroku
- Amazon Connect
- Amazon ECS with the Fargate launch type
- Amazon ECS with the EC2 launch type
- Zoom
- Amazon DynamoDB
- Google Compute Engine
- Azure App Service
- A server in your office cupboard
- Amazon WorkSpaces
- GitHub
Show the answers
| # | Product | Rung | Who patches the OS? |
|---|---|---|---|
| 1 | Gmail | SaaS | |
| 2 | Amazon EC2 | IaaS | You |
| 3 | AWS Lambda | Serverless (FaaS) | AWS |
| 4 | Elastic Beanstalk | PaaS (it creates EC2 servers for you and manages the platform, though you can still reach them) | AWS manages platform updates |
| 5 | Salesforce | SaaS | Salesforce |
| 6 | Amazon S3 | Serverless storage (often described as a managed service or IaaS-level storage) | AWS |
| 7 | Amazon RDS | PaaS-like managed service | AWS |
| 8 | MySQL on EC2 | IaaS (you run it) | You |
| 9 | Dropbox | SaaS | Dropbox |
| 10 | Heroku | PaaS | Heroku |
| 11 | Amazon Connect | SaaS | AWS |
| 12 | ECS on Fargate | CaaS (serverless containers) | AWS |
| 13 | ECS on EC2 | CaaS on IaaS: you manage the instances that run the containers | You |
| 14 | Zoom | SaaS | Zoom |
| 15 | DynamoDB | Serverless database | AWS |
| 16 | Google Compute Engine | IaaS | You |
| 17 | Azure App Service | PaaS | Microsoft |
| 18 | Office cupboard server | On-premises | You (and the air conditioning, and the power) |
| 19 | Amazon WorkSpaces | Desktop as a service (SaaS-like) | AWS manages the service, you manage the desktop images and apps you add |
| 20 | GitHub | SaaS | GitHub |
If you disagreed on #4, #6 or #19, that is fine. These sit between rungs. What matters is that you gave a reason using "who patches the OS" and "what do I deploy".
Step 2. Draw StackCafe v1 three ways#
Draw three boxes-and-arrows sketches of the ordering website: on IaaS, on serverless, and on SaaS. Under each, list three tasks you must do every month. For IaaS you should list things like "patch the OS", "check backups" and "resize the server". For serverless the list is much shorter. For SaaS it is nearly empty. That difference is the whole point of the chapter.
Step 3. Answer three questions out loud#
- Why does Maya's cloud bill fall when traffic is spiky?
- Which rung would you choose for a bank's decades-old application that must run unchanged, and why?
- What does a SaaS customer still have to secure?
Show answer
1. Because she pays for capacity only while she uses it, instead of for the peak all day. 2. IaaS, as a rehost, because it needs no code change, and later it can be modernized step by step. 3. Their users, passwords and MFA, access rules and the data they put in.
Cleanup: nothing to clean. No AWS resources were created.
Cheat Sheet#
| Model | You bring | Provider runs | AWS examples | Others |
|---|---|---|---|---|
| IaaS | OS, runtime, app, data | Hardware and virtualization | EC2, EBS, VPC | Azure VMs, Google Compute Engine |
| CaaS | Container image, data | Orchestration, servers (Fargate) | ECS, EKS, Fargate | Azure Container Apps, Google Cloud Run |
| PaaS | Code, data | Runtime, OS, scaling | Elastic Beanstalk, App Runner, RDS | Heroku, App Engine, Azure App Service |
| Serverless / FaaS | Function code, data | Everything, including scaling to zero | Lambda, S3, DynamoDB, API Gateway | Azure Functions, Google Cloud Functions |
| SaaS | Users, data, settings | The whole application | Amazon Connect, WorkSpaces | Gmail, Salesforce, Zoom, Microsoft 365 |
FIVE CLOUD TRAITS on-demand self-service | broad network access | resource pooling | rapid elasticity | measured service
SIX ADVANTAGES variable expense | economies of scale | stop guessing capacity | speed and agility | no data-center chores | global in minutes
DEPLOYMENT MODELS public | private | hybrid (on-prem + cloud) | multi-cloud (2+ clouds) | edge | sovereign
THE TEST Who patches the OS? You -> IaaS Provider + you deploy code -> PaaS/CaaS/serverless No code at all -> SaaS
NINES 99.9% = 8.76 h/yr 99.99% = 52.6 min/yr 99.999% = 5.26 min/yr
RULE buy > managed > serverless > servers > own data centerQuick Recap#
- The cloud is renting computing resources over the internet, on demand, and paying for what you use, made possible by virtualization and an API-driven control plane.
- The five traits: on-demand self-service, broad network access, resource pooling, rapid elasticity, measured service.
- The ladder from most to least control: on-prem, IaaS, CaaS, PaaS, serverless, SaaS. More provider work means less operating work for you, and less control.
- The test: who patches the OS, and what do I deploy?
- Serverless means no server management, automatic scaling, pay per use and built-in HA. Servers still exist.
- Deployment models: public, private, hybrid (on-prem plus cloud), multi-cloud (several providers), edge, sovereign.
- Six advantages: variable expense, economies of scale, no guessing capacity, speed, no data-center chores, global reach.
- Elasticity is automatic scaling up and down. Availability is uptime. Durability is not losing data.
- Your data and access are always your responsibility.
Practice Section A: Certification-Style Scenarios (10)#
Click Show answer to reveal each answer. Try before you open it. Aim for 9 or more.
Q1. A company wants to run its own custom operating system image and install licensed software that needs root access. Which cloud service model fits best?
A. SaaS
B. PaaS
C. IaaS
D. Serverless (FaaS)
Show answer
C. Only IaaS (for example Amazon EC2) gives control of the operating system. SaaS, PaaS and serverless all hide the OS.
Q2. A startup wants to upload its Python web app and let AWS handle the servers, patching, load balancing and scaling, with no server administration. Which model describes this?
A. IaaS
B. PaaS
C. On-premises
D. Private cloud
Show answer
B. PaaS (for example AWS Elastic Beanstalk or AWS App Runner) runs the platform for you. You deploy only code.
Q3. Employees use a hosted email and calendar service through a web browser. The company manages only user accounts and sharing rules. What is this?
A. IaaS
B. PaaS
C. SaaS
D. Hybrid cloud
Show answer
C. A complete application used over the internet is SaaS. The customer still manages users and data.
Q4. A hospital must keep patient records in its own building, but wants to run analytics in AWS, connected by a dedicated link. Which deployment model is this?
A. Public cloud
B. Multi-cloud
C. Hybrid cloud
D. Community cloud
Show answer
C. On-premises plus public cloud, connected, is hybrid. Multi-cloud would mean two or more cloud providers.
Q5. A retailer's traffic is 10 times higher for four hours each day. Which cloud advantage best matches the ability to pay for peak capacity only during those hours?
A. Go global in minutes
B. Stop guessing capacity
C. Increase data durability
D. Fixed expense
Show answer
B. Elastic capacity removes the need to guess and buy for the peak. It also converts fixed cost into variable cost, but "stop guessing capacity" is the direct match.
Q6. Which statement about serverless computing is correct?
A. There are no physical servers involved
B. You must patch the operating system yourself
C. You do not manage servers, and you pay based on use
D. It can only run for days at a time
Show answer
C. Servers still exist, but AWS manages them, scaling is automatic and billing is per use. Lambda functions run for at most 15 minutes, so D is wrong.
Q7. A system must be unavailable for no more than about 52 minutes per year. Which availability target is that?
A. 99%
B. 99.9%
C. 99.99%
D. 99.999%
Show answer
C. 99.99 percent allows about 52.6 minutes of downtime a year. 99.9 percent allows 8.76 hours, and 99.999 percent about 5.26 minutes.
Q8. A team moves its on-premises database to Amazon RDS. Which responsibility does AWS now take over?
A. Designing the database schema
B. Patching the operating system and database engine
C. Deciding which users can read the data
D. Writing the application queries
Show answer
B. RDS is a managed service, so AWS handles OS and engine patching. Schema, access and queries remain the customer's responsibility.
Q9. Which pair of terms describes the difference between a system that can add capacity and a system that adds and removes capacity automatically as demand changes?
A. Durability and availability
B. Scalability and elasticity
C. Latency and throughput
D. Capex and opex
Show answer
B. Scalability is the ability to grow. Elasticity is automatic growth and shrinkage that follows demand.
Q10. A company already uses AWS and also uses Google Cloud for one analytics service. How is this best described?
A. Hybrid cloud
B. Private cloud
C. Multi-cloud
D. Edge cloud
Show answer
C. Using two or more public cloud providers is multi-cloud. Hybrid means on-premises plus cloud.
Practice Section B: Interview and Solution Design Questions (10)#
There is no single multiple-choice answer. Say your answer out loud first, then open the model answer. Interviewers care about clear reasoning and trade-offs.
I1. Explain cloud computing to a non-technical manager in under a minute.
Show model answer
Instead of buying servers and building a room for them, we rent computing power from a provider such as AWS over the internet. We create what we need in minutes, pay only for what we use, and give it back when we are done. The provider owns the buildings and hardware, so we spend our time on the product. It is like using the electricity grid instead of running our own power plant.
I2. What is the difference between IaaS, PaaS and SaaS? Give one AWS or well-known example of each.
Show model answer
It is about how much the provider manages. IaaS gives raw servers, disks and networks, and I manage the OS and above (Amazon EC2). PaaS gives a platform where I deploy code and the provider manages OS, runtime and scaling (Elastic Beanstalk, Heroku). SaaS is a finished application where I only manage users and data (Gmail, Salesforce). A quick test: who patches the operating system, and what do I deploy?
I3. A team says "we chose serverless because it has no servers." What do you say?
Show model answer
Servers exist, but the provider operates them. What the team gets is no server management, automatic scaling including to zero, pay-per-use billing, and built-in availability across data centers. The trade-offs to mention: execution time limits, possible cold starts, and costs that can rise on steady heavy traffic.
I4. A client wants to move 200 on-premises servers to AWS in three months. Which service model and approach do you suggest, and what do you tell them about the longer term?
Show model answer
Rehost (lift and shift) onto IaaS, because it needs no code change and fits the deadline. I would also tell them that rehosting alone rarely saves money. After the move we pick the highest-value systems to replatform onto managed services (for example databases to RDS) and later refactor selected applications to containers or serverless. Each step is justified by cost, risk or agility.
I5. When would you advise against moving a workload to the public cloud?
Show model answer
When law forbids hosting the data where a Region exists, when machines need single-digit-millisecond latency that no Region or edge option can give, or when a huge, perfectly steady workload runs at very high utilization for years and owned hardware is cheaper. Even then I would consider hybrid options such as AWS Outposts or Local Zones, and I would compare costs honestly rather than assume.
I6. Describe a hybrid architecture and one problem it solves.
Show model answer
A bank keeps its core customer database in its own data center because of regulation, and connects it through AWS Direct Connect (backed up by a VPN) to a VPC where new web and mobile apps and analytics run. It solves the problem of modernizing the customer experience without moving restricted data. The new risks are network dependency and the cost of operating two environments.
I7. Prove with numbers that elasticity can lower cost.
Show model answer
Suppose a server costs $0.10 per hour. Traffic needs 2 servers most of the day and 10 servers for 4 hours. Buying for the peak means 10 servers x 24 h x 30 days = 7,200 server-hours, or $720 a month. Elastic scaling uses 2 x 24 x 30 = 1,440 plus 8 x 4 x 30 = 960, which is 2,400 server-hours, or $240. The saving, $480 a month, comes only because demand is uneven. With flat demand the saving disappears.
I8. What is the difference between availability and durability? Give an example where one is high and the other low.
Show model answer
Availability is the share of time a system can be used. Durability is the likelihood that stored data is never lost. A service can be down for an hour (lower availability) yet keep every byte safe (high durability). Amazon S3 is designed for 11 nines of durability, but a Regional outage could still make objects temporarily unreachable.
I9. You must host a customer-facing ordering site for a three-person startup with spiky traffic. Which rung of the ladder do you pick, and what do you say if they ask "why not just use servers?"
Show model answer
I would start with serverless (S3 and CloudFront for the front end, API Gateway and Lambda for logic, DynamoDB for data), or even a SaaS ordering product if custom features are not needed. A three-person team has no time for patching and capacity planning, spiky traffic suits scale-to-zero billing, and availability across data centers is built in. I would tell them servers remain a fine choice later if traffic becomes steady and heavy, or if they need full OS control.
I10. A colleague says "we use SaaS, so security is the vendor's job." How do you respond?
Show model answer
The vendor secures the application and the infrastructure under it. We still own our users, authentication strength (MFA), access and sharing settings, and the data we put in. Many SaaS incidents come from public links, ex-employees with access, or weak passwords. I would propose single sign-on with MFA, least-privilege roles and regular access reviews.
Next up: Chapter 3. AWS Global Infrastructure: Regions, Availability Zones, and the Network That Joins Them (what is inside a data center, how far apart Availability Zones are, how they and the Regions are connected, and how to choose where to run).