Sub topic 7
Service models: who manages which layer
This chapter assumes you know what a server, an operating system, and an application are. It also assumes you are comfortable with basic networking terms such as IP address and HTTP. The previous chapter described the technology stack. This chapter shows how the three classic service models divide that stack between you and the provider.
The idea behind a service model
Every running application sits on a stack of layers. From the bottom up, these are the physical hardware, virtualization, the operating system, the runtime, the application code, and the data the application handles. Someone has to manage each layer.
A service model is an agreement about where the provider's work stops and yours begins. The provider manages everything below a certain line. You manage everything above it. Moving the line up gives you less work and less control.
The three classic models place the line in different spots:
- IaaS (Infrastructure as a Service): the provider manages hardware and virtualization.
- PaaS (Platform as a Service): the provider also manages the operating system and runtime.
- SaaS (Software as a Service): the provider manages the whole application. You only use it and configure it.
The split in a table
| Layer | IaaS | PaaS | SaaS |
|---|---|---|---|
| Data and configuration | You | You | You |
| Application | You | You | Provider |
| Runtime | You | Provider | Provider |
| Operating system | You | Provider | Provider |
| Virtualization | Provider | Provider | Provider |
| Hardware and facilities | Provider | Provider | Provider |
In every model you remain responsible for your own data and for who can access it. That row never moves.
What each line looks like in practice
With IaaS, you request a virtual machine. You then patch its operating system and install your runtime.
# 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 1With PaaS, you supply only code. The platform provisions the servers and the runtime.
from flask import Flask
application = Flask(__name__)
@application.route("/")
def index():
return "Hello from a PaaS-hosted app"With SaaS, you consume a finished product through its interface or 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/contactsCommon errors
- Assuming the provider secures everything. In IaaS, an unpatched operating system is your problem, not the provider's.
- Treating the model as a property of the vendor. One provider can sell all three models. The model describes a particular service, not the company.
- Forgetting the data row. Even with SaaS, you decide who has access to your data and how it is configured.
- Seeing the models as strict categories. Real services often sit between two of them. A later chapter covers serverless and containers as a service.
Exercise
A team runs a web app on a virtual machine they rent. A security flaw is found in the operating system. Which service model is this, and who must install the patch?
Show answer
This is IaaS. The team must install the patch, because the operating system sits above the line the provider manages.
Exercise
A company uses a hosted email service and wants to stop a former employee from reading shared mailboxes. Which layer is involved, and who is responsible for it?
Show answer
The data and access configuration layer. The company is responsible, even though the model is SaaS and the provider runs everything else.