Cloud service models: IaaS, PaaS, SaaS and serverless
IaaS, PaaS, SaaS and serverless answer one question: which layers you run and which the provider runs. How to choose, and where the cost curves cross.
The Linux server from an operator's seatWhat a container really is
Cloud service models: IaaS, PaaS, SaaS and serverless
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- The service models differ in one thing: how far up the stack the provider takes over. IaaS stops at the virtual machine, PaaS takes the OS and runtime, FaaS takes the server entirely, and SaaS is the finished application.
- Whatever the provider does not run, you do. On IaaS that includes patching the OS, which is easy to forget because nothing breaks until it does.
- Serverless means you never manage a server and pay per use, usually scaling to zero. Functions as a service is the best-known kind, but managed queues and databases billed per request are serverless too.
- Per-request pricing beats an always-on machine at low or spiky traffic and loses at steady high traffic, so work out the break-even for your own numbers.
- Every major cloud sells every model. Pick per workload, not per company.
The problem: someone has to run every layer
An application sits on a stack. From the bottom: a building with power and cooling, physical servers, a network, virtualization, an operating system, a language runtime, your code, and your data. When you ran your own Linux server, every layer was yours. The cloud sells you the option to hand some of those layers to someone else.
The service models are names for where the hand-off happens. Think of it as a line drawn across the stack. Below the line the provider runs it, patches it and is paged when it breaks. Above the line it is your job.
The four models
Infrastructure as a service (IaaS). You rent virtual machines, disks and networks. The provider runs the data center and the hypervisor. You choose the OS image and from then on you patch it, configure it and run your software on it. AWS EC2, Azure Virtual Machines and Google Compute Engine are the standard examples.
Platform as a service (PaaS). You hand over code or a container image, and the platform runs it. The OS, the runtime and often the load balancer and TLS are the provider’s problem. AWS Elastic Beanstalk, Azure App Service and Google App Engine are the classic forms. Managed container platforms like Google Cloud Run, Azure Container Apps and AWS App Runner sit here too.
Software as a service (SaaS). You use a finished application. Email, a CI service, an error tracker. Your only job is configuration and the data you put in.
Serverless and functions as a service (FaaS). You write a function and say which event triggers it: an HTTP request, a file landing in a bucket, a message on a queue. The provider starts it on demand, runs as many copies as the traffic needs, and stops them all when it is quiet. You pay per invocation and per unit of memory-time. AWS Lambda, Azure Functions and Google Cloud Run functions are the main ones.
“Serverless” is wider than FaaS. It is a billing and operating model: no servers to manage, pay per use, scale to zero. A managed queue or a database billed per request is serverless in the same sense.
What you still own
Moving up the stack removes work but never all of it. Even on SaaS you own who has access and what data goes in. On FaaS you still own your dependencies, your secrets and your timeouts. On IaaS you own a whole OS, which is the item teams most often drop. A VM launched two years ago from an image nobody updates is the classic unpatched machine.
Each step up also costs you control. A function has a maximum run time, a cold start when a new copy boots, and limits on memory and package size. A PaaS picks the runtime versions for you. Before choosing, ask which limits your workload would hit.
A worked example: where the cost curves cross
Per-request billing sounds cheap, and at low traffic it is. At steady traffic a machine you keep busy is usually cheaper. I wrote a small script to find the crossover. The rates are round illustrative numbers, not any provider’s real price list. Plug in current prices from your provider’s pricing page before you rely on the answer.
VM_PER_HOUR = 0.04 # one small always-on VM
FN_PER_MILLION = 0.20 # per million invocations
FN_PER_GB_SECOND = 0.0000167
MEM_GB, DUR_S = 0.5, 0.2 # 512 MB function, 200 ms per request
I ran it with Python 3:
always-on VM: $29.20/month whatever the traffic
function: $1.87 per million requests
100,000 req/month function $ 0.19 VM $29.20
1,000,000 req/month function $ 1.87 VM $29.20
5,000,000 req/month function $ 9.35 VM $29.20
20,000,000 req/month function $ 37.40 VM $29.20
break-even ~ 15,614,973 requests/month (~5.9 req/s sustained)
With these numbers, a function is cheaper until traffic averages about six requests a second. Most of the cost is memory-time, not the per-call fee, so halving the duration or the memory moves the break-even a long way. The comparison is also unfair to the VM in one direction and to the function in another. One VM gives you no redundancy, and a production setup needs at least two. The function’s bill includes scaling and patching that someone would otherwise do by hand. That engineering time belongs in the same sum.
How to choose
Start from the workload, not the brand.
- Spiky, event-driven or rarely used (webhooks, nightly jobs, image resizing on upload): FaaS.
- A normal web service or API: a container on a PaaS-style platform, so you skip OS patching but keep long-running processes.
- Special needs (a kernel module, a GPU driver, licensed software tied to a machine): IaaS.
- A commodity function your business does not differ on (email, chat, CI): SaaS.
Most teams end up with all four at once. The cost lesson comes back to the money side, and the software-architect roadmap’s serverless trade-offs covers the design side in more depth.
About the video
“What is FaaS (Functions as a Service)?” is an IBM Technology lightboard video by Jason Goode, published February 2021, 10 minutes 52 seconds. Its chapters walk the software stack and then IaaS, PaaS, FaaS and SaaS in turn, before a section on serverless versus FaaS and an e-commerce example. That is this lesson’s structure, from the angle of functions. Product names in it are IBM’s, so use the AWS, Azure and Google names above. English is judged from the title, description and channel. Cloud X Berry’s shorter video adds containers as a service and frames the models as a moving responsibility line, and in28minutes compares managed services across the three big clouds.
Where this fits
The service model decides how much of the stack you run. The next question is where it physically runs and what happens when that place fails: regions, availability zones and failure domains.
Check yourself
On IaaS, who is responsible for patching the guest operating system?
You are. The provider runs the hardware and the hypervisor, but everything inside the virtual machine, including the OS, is yours.
What is the difference between serverless and functions as a service?
FaaS is one serverless product: you upload a function that runs per event. Serverless is the wider idea of paying per use with no servers to manage, which also covers things like managed queues and per-request databases.
A service gets 50 requests a second all day, every day. Is a function or a small VM likely cheaper?
Usually the VM or a container on reserved capacity. Steady, high traffic keeps a machine busy, while per-request billing keeps charging for every call. Check the break-even with your provider's current prices.
Which AWS, Azure and Google Cloud products run a single function on an event?
AWS Lambda, Azure Functions and Google Cloud Run functions (formerly Cloud Functions).
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.