Sub topic 6
The stack: from hardware to application
What this chapter covers
Every computing workload sits on a stack of layers. Cloud service models differ only in where the provider's responsibility stops and yours starts. This chapter names the layers, shows what each one does, and explains why the order matters for the rest of the tutorial.
This chapter assumes you know what a server, an operating system, and an application are. It also assumes basic networking vocabulary such as IP address and HTTP.
Why a stack?
A running application depends on many things beneath it. Your code needs a runtime. The runtime needs an operating system. The operating system needs a machine, and the machine needs power, cooling, and network cables. Each layer uses the services of the layer below and offers services to the layer above.
This layering is why cloud services can be sold in pieces. A provider can take over the bottom layers and hand you the rest. The three classic service models are three different places to draw that line.
The layers, from the bottom up
The table lists the layers in the order used throughout this tutorial. Layer names vary between books and vendors, but the ordering is stable.
| Layer | What it contains | Typical examples |
|---|---|---|
| Facilities | Buildings, power, cooling, physical security | Data center halls, generators |
| Networking | Cables, switches, routers, firewalls, links to the internet | Top-of-rack switches, backbone links |
| Servers and storage | Physical computers and disks | Rack servers, disk arrays |
| Virtualization | Software that splits physical machines into virtual ones | Hypervisors |
| Operating system | The kernel and system services | Linux, Windows Server |
| Middleware and runtime | Language runtimes, web servers, libraries, frameworks | Python interpreter, Java runtime, Nginx |
| Application | Your code and its logic | A Flask app, a billing service |
| Data | The information the application stores and processes | Customer records, uploaded files |
Some diagrams fold these into fewer boxes, for example "infrastructure, platform, application". The three-box version is a summary of this longer list.
Facilities, networking, servers, and storage
These are the physical layers. They cost a lot of money up front, take months to expand, and need staff on site. You never see them in the cloud, and the provider always manages them. In every cloud service model, this part is the provider's job.
Virtualization
Virtualization is software that lets one physical server act as many separate virtual machines. A later chapter covers it in detail. For this chapter, it is enough to know where it sits. It is the layer that turns fixed hardware into units you can request, resize, and release in minutes. The provider operates it in every model.
Operating system
The operating system manages memory, processes, files, and devices. It also needs regular security patches. Whoever owns this layer must apply those patches, manage user accounts on the machine, and configure the host firewall. This layer is often where the first real responsibility lands on the customer.
Middleware and runtime
Middleware and runtime is the software between the operating system and your code. It includes the language runtime (such as the Python interpreter), the web server, and shared libraries. Version choices matter here. An application written for Python 3.12 will not necessarily run on 3.8.
Application
The application layer is the code that does the actual work for users. It can be code you wrote, or software someone else wrote and you install, or a finished product you only use.
Data
Data is the information your application creates and keeps. It is listed separately because it is the layer you almost never fully hand off. Even when you use a finished product, the content you put in it is yours. You remain accountable for who can see it and for how long you keep it.
Seeing the stack in a real command
Launching a virtual machine on AWS shows where the line falls for infrastructure.
# IaaS: you choose the machine image and size, then manage the OS and everything above it.
# The AMI ID below is a placeholder; use an image ID that exists in your region.
aws ec2 run-instances \
--image-id ami-0123456789abcdef0 \
--instance-type t3.micro \
--count 1The command specifies two things. The image ID selects a starting operating system. The instance type selects the virtual hardware size. You said nothing about buildings, power, switches, or hypervisors, because the provider already owns those layers. After the instance starts, though, the operating system and everything above it are yours to configure and patch.
Compare this with a platform deployment:
# PaaS: deploy application code to a managed platform (AWS Elastic Beanstalk CLI).
eb init my-app --platform python --region us-east-1
eb create my-app-env
eb deployHere you choose a platform ("python") and never mention an operating system. The line has moved up. The provider now also owns the operating system and the runtime, and you supply the application and its data.
The boundary moves upward
The following diagram shows the same stack with the three service models marked by where your responsibility begins.
Read the diagram from the bottom. Everything below the dotted line's target is the provider's. The higher the line lands, the less you manage, and the less you can change.
A worked example: one web shop, three ways
Suppose you run a small online shop. The same shop can live at different points on the stack.
- Self-managed on rented virtual machines (IaaS). You rent a virtual machine, install Linux, install Python and Nginx, copy your code, and keep it all patched. You can tune anything. You also get paged when a kernel update breaks something.
- Code on a managed platform (PaaS). You upload the Flask application and the platform provisions servers, operating system, and runtime. Your code can be this small:
from flask import Flask
application = Flask(__name__)
@application.route("/")
def index():
return "Hello from a PaaS-hosted app"Your work is the code, its dependencies, and its configuration. You cannot choose the kernel or install arbitrary system packages the platform does not allow.
- A hosted shop product (SaaS). You sign up, pick a theme, and upload products. You write no code. You can reach the product through its interface or a web API:
# SaaS: you consume the finished product through its interface or API.
# api.example.com and API_TOKEN are placeholders.
curl -H "Authorization: Bearer $API_TOKEN" \
https://api.example.com/v1/contactsYou manage your product data, user accounts, and settings. Nothing below that is visible to you.
The shop is the same in all three cases. Only the number of layers you operate changes.
Common errors when reading the stack
- Treating "the provider manages it" as "nobody needs to think about it". A managed layer can still fail, change versions, or be configured in a way that affects you. You depend on it even if you do not operate it.
- Forgetting the data layer. In every model, you decide what data goes in, who may access it, and how it is backed up or deleted. No service model removes that responsibility.
- Assuming the layer list is universal. Vendors group and rename layers. A container platform or a function service may blur the operating system and runtime layers. Compare the substance (who patches what), not the labels.
- Assuming lower is better or higher is better. Lower layers give control and cost effort. Higher layers give speed and cost flexibility. The right position depends on the workload, which a later chapter addresses.
Where this leads
With the stack named, the next chapters can define each service model as a statement about layers. IaaS hands you the layers from virtualization down. PaaS also hands you the operating system and runtime. SaaS hands you the application as well. Shared responsibility, pricing, and comparison all build on this ordering.
Exercise
A team runs a Python API on a virtual machine they rent from a cloud provider. They install Linux updates themselves and choose the Python version. Which stack layers does the provider manage, and which does the team manage? Which service model is this? What would change if they moved the same API to a platform such as Elastic Beanstalk?
Show answer
The provider manages facilities, networking, servers and storage, and virtualization. The team manages the operating system, middleware and runtime, application, and data. This is IaaS. On a platform such as Elastic Beanstalk (PaaS), the provider would also manage the operating system and the runtime. The team would manage only the application code, its configuration, and its data, and would give up the freedom to choose the kernel or install arbitrary system software.
Exercise
Even with a SaaS product, which layer of the stack can you never fully hand off to the provider, and why?
Show answer
The data layer. The content you put into the product remains yours, so you are still accountable for who can access it, how long it is kept, and whether it is correct, even though the provider runs every layer beneath it.