Every application in production needs the same six layers. Read them from the bottom up:
| Layer | What it is | In the store |
|---|---|---|
| Data and access | what the application stores and who may read it | orders, accounts, DB users, API keys |
| Application | your code | the gateway and the services |
| Middleware | what your code needs to run | JDK, web server, Redis |
| OS | the operating system of each machine | Linux |
| Virtualisation | hypervisor slicing a host into VMs | KVM, Xen |
| Hardware | servers, disks, network, power, cooling | the datacentre |
From left to right, the provider takes over more of the stack: you operate it · provider operates it
Pizza as a service. On-premises: you cook at home · IaaS: you rent a kitchen · PaaS: you order delivery · SaaS: you eat at a restaurant — and you still decide who sits at your table.
Find the event and read across the row: you operate it · provider operates it
The usual setup of each model. On CaaS and PaaS the platform scales, but you still set the limits; on managed Kubernetes with classic node groups the OS of the nodes is still partly yours.
The store runs on a PaaS and a flaw is published in the Linux kernel. What does your team do?
NIST defines three foundational models: IaaS, PaaS and SaaS. The market later added CaaS and FaaS between them.
Each model gets the same parts, so you can compare them:
What you deploy tells the models apart: a VM (IaaS), an image (CaaS), code (PaaS), a function (FaaS) or nothing (SaaS).
You rent a machine and do the rest. You hand over datacentre, hardware and hypervisor; you keep the OS (patches, hardening), runtime, code, data, firewall rules and backups.
aws ec2 run-instances --image-id <ubuntu-ami> --instance-type t3.medium --key-name <key>
ssh ubuntu@<public-ip>
sudo apt update && sudo apt install -y openjdk-21-jre-headless nginx
java -jar order.jar
That is just the first day: configure nginx, restart the service if it crashes, patch the OS, schedule backups.
AWS EC2, Google Compute Engine, Azure Virtual Machines, DigitalOcean Droplets.
You hand over a container image; the platform runs it. The provider handles scheduling, networking, scaling and machine health; everything inside the image (base image, JDK, code) is still yours.
docker build -t <registry>/order:1.0 .
docker push <registry>/order:1.0
gcloud run deploy order --image <registry>/order:1.0 --region southamerica-east1 --max-instances 10
The same image you run with Docker Compose: moving provider means pushing it somewhere else.
AWS ECS / Fargate, Google Cloud Run, Azure Container Apps.
You hand over the code; the platform builds and runs it. It supplies OS, JDK, deploys, load balancing and scaling; you keep the code, the configuration (env vars, scaling rules), data and access.
heroku create store-order
heroku addons:create heroku-postgresql:essential-0
git push heroku main
heroku ps:scale web=2
A buildpack finds the pom.xml and builds the project: nobody installed a JDK or a database.
Heroku, AWS Elastic Beanstalk, Google App Engine, Azure App Service, Railway, Render.
You hand over a single function; it runs only when something calls it. PaaS taken to the extreme (serverless): instances on demand, scale to zero, pay per invocation and per millisecond.
The whole order service is not a good fit, but the e-mail sent after each order is:
public class OrderCreated implements RequestHandler<Map<String, Object>, String> {
@Override
public String handleRequest(Map<String, Object> event, Context context) {
// send the confirmation e-mail for this order
return "sent";
}
}
AWS Lambda, Google Cloud Functions, Azure Functions, Cloudflare Workers.
Serverless containers blur the line. Cloud Run and Azure Container Apps also scale to zero and bill by usage, but run any image. "Serverless" is the operating model, not only functions.
You use the product; the provider runs everything else. You keep user accounts and permissions, the data you enter and the integrations (APIs, webhooks).
Google Workspace, Salesforce, Slack, GitHub, Datadog, Shopify.
Not everything fits on the ladder. DBaaS applies the same handover to a single component: instead of operating a Postgres server, you rent one.
| Running Postgres on a VM | Using a DBaaS |
|---|---|
| You install it and patch the OS and the database | The provider patches in a window you choose |
| You write backup scripts and test them | You set the retention period |
| You build replication and failover | You turn on an option (Multi-AZ on RDS) |
| Schema, queries, access | Schema, queries, access: these stay with you |
AWS RDS, Amazon Aurora, Google Cloud SQL, Azure Database, Neon.
| Model | Abbreviation | Examples |
|---|---|---|
| Storage as a Service | STaaS | AWS S3, Google Cloud Storage, Backblaze B2 |
| AI / ML as a Service | AIaaS | AWS Bedrock, Google Vertex AI, Azure AI |
| Monitoring as a Service | — | Datadog, New Relic, Grafana Cloud |
| Security as a Service | SECaaS | Cloudflare, AWS Shield, Snyk |
| Communication as a Service | CPaaS | Twilio, SendGrid, AWS SES |
Read by rows, watching each characteristic change from left to right:
| On-premises | IaaS | CaaS | PaaS | FaaS | SaaS | |
|---|---|---|---|---|---|---|
| You deploy | everything | a VM | an image | code | a function | nothing |
| Control | maximum | high | medium | medium | low | minimal |
| Time to go live | months | hours | minutes | minutes | minutes | immediate |
| Scaling | buy hardware | manual or scripted | automatic (some to zero) | automatic | automatic to zero | automatic |
| You pay for | hardware (CapEx) | VM-hours | container time | instances or usage | invocations and duration | users or seats |
| Portability | full | high | high (the image) | medium | low (vendor API) | low (data export) |
| Model | AWS | Google Cloud | Microsoft | Other providers |
|---|---|---|---|---|
| IaaS | EC2 | Compute Engine | Azure Virtual Machines | DigitalOcean Droplets, Oracle Cloud Compute, Magalu Cloud |
| CaaS | ECS / Fargate, EKS | Cloud Run, GKE | Azure Container Apps, AKS | DigitalOcean Kubernetes, Fly.io |
| PaaS | Elastic Beanstalk | App Engine | Azure App Service | Heroku, Railway, Render |
| FaaS | Lambda | Cloud Run functions | Azure Functions | Cloudflare Workers, Vercel Functions |
| SaaS | Amazon Connect, QuickSight | Google Workspace | Microsoft 365, Dynamics 365 | Salesforce, Slack, GitHub, Shopify, TOTVS |
| Managed blocks | RDS, ElastiCache, MSK | Cloud SQL, Memorystore | Azure Database, Azure Cache for Redis | Neon, Upstash, Confluent Cloud |
Read by columns: a model describes a service, not a company — AWS appears on every row. The big clouds offer almost every model; smaller providers specialise in one step of the stack.
Per component, not per system. Start from the most managed option; ask in order and stop at the first yes (each no goes one step down):
Running each component through the questions gives one reasonable result, with the same shape as the course project:
Real systems mix models: CaaS for the services, DBaaS for the data, FaaS for the sporadic work. The data and access row stays yours in every box.
| Component | Do it yourself | Managed option | What changes for the team |
|---|---|---|---|
| gateway, account, order | Compose on EC2 (IaaS) | EKS or ECS Fargate (CaaS) | no SSH or OS patching; manifests instead |
| Postgres | Postgres on EC2 | RDS (DBaaS) | backups, replication, failover become options |
| Redis | container on the VM | ElastiCache (DBaaS) | survives a VM reboot; pay per node |
| Kafka | brokers on VMs | Amazon MSK | broker patching and replacement move to AWS |
| Order notification | consumer always running | Lambda on the Kafka topic (FaaS) | pay per message; cold starts on an async path |
| CI/CD | Jenkins in a container | GitHub Actions (SaaS) | no Jenkins server to upgrade |
| Monitoring | Prometheus and Grafana | Grafana Cloud or Datadog (SaaS) | no metric storage to size |
Real systems mix models — the same shape as the course project. The data and access row never goes away: you still decide who connects to RDS and who reaches the gateway.
Where would you run exchange, which converts currencies by calling an external rate API?
0.0.0.0/0, a leaked access key.On the class page: try the simulators to move the line between you and the provider, and compare costs.
Objectives: explain what makes a service "cloud" and CapEx vs OpEx; place IaaS, CaaS, PaaS, FaaS and SaaS on the responsibility stack, saying who acts when something breaks; compare the models; choose a model per component; name what never moves to the provider. Outline: (1) what makes it cloud; (2) the responsibility stack; (3) climbing the stack, one model at a time; (4) managed building blocks; (5) comparing the models; (6) how to choose, the store component by component; (7) mistakes.
Each option draws a different line between what your team operates and what someone else operates. That line is what a cloud service model defines.
The gap between the staircase and the demand is the cost of guessing: orange is money spent on capacity nobody uses, red is customers turned away. Autoscaling on OpEx closes the gap, but pays a premium per unit (see the cost simulator on the page).
This is the picture to remember. Ask the class to read it column by column before the next slide.
Control and portability fall as time to go live improves. FaaS is the outlier on portability: the code is written against a vendor API.
The store could use a single provider (on AWS: EKS for the services, RDS for Postgres) or mix providers (GitHub for the code and CI): the requirement of each component decides, as the next slide shows. Cloud Run functions was formerly called Cloud Functions.
Arrows: client → gateway → account and order; account and order → Postgres; order → Redis and Kafka; Kafka triggers the Lambda, which sends the e-mail through SES.