Sub topic 16
Choosing a model for a workload
This chapter assumes you know the layers of the technology stack, what IaaS, PaaS, and SaaS each hand to the provider, and how the shared responsibility split changes between them. Here you use that knowledge to make a decision. You will turn a workload's requirements into a service model, and you will learn the mistakes that make people pick the wrong one.
Choosing is a matching problem
No service model is better than the others in general. Each one trades control for less operational work. Moving from IaaS to PaaS to SaaS, the provider manages more layers, so you do less work and have fewer options.
A good choice comes from the workload. Ask what the workload needs, then pick the model that supplies it with the least management effort you can accept. Start from the highest-level model that works, which is usually SaaS, and move down only when a requirement forces you to.
The decision questions
Work through these questions in order. Each one removes options.
- Does a finished product already do the job? Email, payroll, CRM, and ticketing are well-served by existing products. If one fits, use SaaS. Building the same thing yourself costs more than any subscription.
- Is this custom code that you write? If so, SaaS is out, and the choice is between PaaS and IaaS.
- Does the code fit the platform's supported runtimes and limits? If the platform supports your language, your dependencies, and your scaling pattern, use PaaS. You deploy code and the provider handles the operating system, patching, and runtime.
- Do you need control the platform hides? Examples are a custom kernel module, a specific operating system version, an unusual network setup, licensed software that installs on a server, or a specialized GPU driver. These push you to IaaS.
- Do rules constrain where and how the workload runs? Compliance, data residency, and audit requirements may demand control over the host, or may demand a provider with certain certifications. Check these before you commit.
- Can your team operate what you choose? IaaS needs people who patch operating systems, configure firewalls, and manage backups. If you have no such people, IaaS carries a real hidden cost.
Worked example: three workloads
The same company has three needs. Each lands on a different model.
| Workload | Key requirement | Model | Reasoning |
|---|---|---|---|
| Company email and calendar | Standard functionality, no custom code | SaaS | A finished product exists. Running your own mail servers adds work and no benefit. |
| Internal web API written in Python | Custom code, standard runtime, variable traffic | PaaS | You only supply code. The platform handles servers, load balancing, and runtime setup. |
| Legacy billing system that needs a specific OS version and a vendor installer | Control of the operating system | IaaS | The software installs on a server, and no managed platform can host it. |
The Python API is a good PaaS fit because the whole application can be this small:
from flask import Flask
application = Flask(__name__)
@application.route("/")
def index():
return "Hello from a PaaS-hosted app"On AWS Elastic Beanstalk you deploy it with three commands:
eb init my-app --platform python --region us-east-1
eb create my-app-env
eb deployThe legacy billing system needs the opposite approach. You pick the machine image and size, then manage everything above the virtual hardware yourself:
# The AMI ID 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 email system needs neither. You sign up, configure users, and use it.
Weighing the factors
Beyond the yes-or-no questions, compare the models on the dimensions from the earlier comparison chapter.
| Factor | Favors IaaS | Favors PaaS | Favors SaaS |
|---|---|---|---|
| Control over OS and runtime | Required | Not needed | Not needed |
| Team operations skill | Strong team available | Small team | Minimal skill |
| Time to first working system | Slowest | Fast | Fastest |
| Flexibility to customize behavior | Highest | Moderate, within platform limits | Lowest, configuration only |
| Cost shape | Pay for capacity, even if idle | Pay for platform usage, often with a premium | Per user or per usage subscription |
| Lock-in risk | Lower, since VMs are portable | Medium, since platform features differ | Higher, since your data and workflows live in the product |
Cost deserves care. A SaaS subscription looks expensive next to a small virtual machine, but the machine also needs engineer time for patching, monitoring, and recovery. Compare total cost, which includes labor, and not only the provider's bill. At large scale the balance can shift the other way: a steady, predictable load can be cheaper on IaaS than on a premium-priced platform.
Mixing models
Real systems rarely use one model. A typical company runs its customer-facing app on PaaS, its database on a managed service, a legacy system on IaaS, and uses SaaS for email, source hosting, and support. Choose per workload, not per company.
Mixing also applies inside one system. You might run application code on PaaS and keep a specialized processing step on IaaS because it needs a GPU driver the platform lacks. Keep the number of models small, because each one adds its own tools, skills, and security responsibilities.
If the platform's limits are the problem but you still want less operational work, look at the models beyond the classic three. Containers as a service lets you bring your own runtime environment, and serverless removes capacity management for event-driven code. Both sit between IaaS and PaaS in control and effort.
Common mistakes
- Choosing IaaS by default. Teams pick virtual machines because they are familiar, then spend months on patching and scaling that PaaS would have handled.
- Choosing PaaS for software that needs a server. Vendor installers and unusual dependencies fail on a platform with fixed runtimes. Test a deployment early.
- Ignoring the responsibility split. Moving to SaaS does not remove your duties. You still manage users, permissions, and the data you put in. Moving to IaaS gives you the operating system's security, which is a duty and not a feature.
- Comparing prices without labor. The cheapest invoice can be the most expensive system.
- Ignoring exit costs. Before committing, ask how you would export your data and move the workload. A PaaS built on proprietary services or a SaaS with no export tool is hard to leave.
- Deciding once and never revisiting. A startup's prototype fits PaaS. After years of growth, parts may justify moving to IaaS for cost or control. Review the choice when requirements change.
A quick decision procedure
- List the workload's hard requirements: runtime, operating system, network, compliance, and scale pattern.
- Check whether an existing product covers them. If yes, choose SaaS.
- If you must write code, check whether a platform supports it. If yes, choose PaaS.
- If a requirement needs host-level control, choose IaaS, and plan staff time for operating it.
- Estimate total cost, including labor and exit costs, and write down the reason for your choice so you can revisit it.
Exercise
A team must run a vendor-supplied analytics package. It ships as an installer that needs a specific Linux distribution and a custom kernel setting. The team has two engineers and wants to do as little server maintenance as possible. Which model fits, and what should the team plan for?
Show answer
IaaS. The installer and kernel setting require control of the operating system, which PaaS and SaaS hide. Because the team then owns patching, security configuration, monitoring, and backups for that machine, it should plan engineer time for those tasks. It should also check whether the vendor offers the same package as a SaaS product, since that would remove the maintenance and would be the better choice if it meets the requirements.
Exercise
A company is building a customer portal in Node.js with standard libraries and unpredictable traffic. Someone proposes virtual machines because "we know how they work." Give two reasons PaaS may be the better first choice, and one condition that would change your answer.
Show answer
First, the platform manages servers, operating system patching, load balancing, and runtime setup, so the team spends its time on the portal. Second, a standard runtime and variable traffic suit the platform's automatic scaling, and the first deployment is faster. The answer would change if the portal needed something the platform cannot supply, such as a native dependency that will not install, a specific operating system version, or a network setup the platform does not allow. Then IaaS becomes the right choice.