Be Software Architecture Wise
Be Wise Apps

Leer en español · Lire en français · Auf Deutsch lesen

Section 10.1 of 10.8 · Intermediate · 22 min read

Cloud service and deployment models

Video lesson

5 min · narrated, with captions
Listen only (audio)
Read the transcript

Where software runs is part of its architecture, and it's expensive to reverse. In this lesson you'll learn the cloud service and deployment models, who is responsible for what, and how to tell when renting is not the cheaper option.

Think of how people find somewhere to live. You can buy land and build a house, rent an empty flat and furnish it, rent a furnished flat, or stay in a hotel. Each step hands more of the work to someone else, and leaves you fewer choices. The hotel is wonderful for a week, and expensive for ten years. Software is the same: you can own servers, rent bare machines, rent a platform, or rent finished software. And whatever you choose, you still lock your own door. Your data, and who can reach it, stay your job.

The service models form a spectrum. With infrastructure as a service, or IaaS, you rent virtual machines, and you still install and patch the operating system and everything above it. With containers as a service, you supply container images and their configuration. The provider runs the control plane, and often the machines too. With a platform as a service, or PaaS, you supply only your application code and its configuration. With functions as a service, you supply individual functions and the events that trigger them. You pay per call and for running time, and nothing when idle. And with software as a service, or SaaS, you rent the whole application and configure it. The useful question is never which label applies, but which tasks remain yours: patching, scaling, backups, failover and upgrades.

Every major provider publishes a shared responsibility model. The provider is responsible for security of the cloud, and you for security in the cloud. This grid shows where the line falls. On your own servers, at the left, every layer is yours, from the data centre upwards. With IaaS, the provider takes the data centre, the hardware and the virtualisation. You still run the operating system, the runtime and your code. With a platform or with functions, you manage only your application code, and your data and access. Now look along the top row. Your data, your identities and permissions, and your configuration stay with you in every model, even SaaS. That matters, because many cloud breaches have been customer configuration failures, not provider failures: storage left readable by anyone, administrator keys in public repositories, permissions far too broad.

Now the deployment models. The public cloud is chosen for elasticity, speed and a large catalogue of managed services. Private, hybrid and multi-cloud all have legitimate reasons, such as regulation, steady load or exit plans. But running every workload portably across several clouds means paying for an exit you may never use. Within a region, spreading across availability zones is the cheap, high value default. Use three rather than two for anything that relies on a quorum, so that a majority survives the loss of one. And cloud native describes how a system is built and operated, not where. A hand-built virtual machine copied unchanged into a public cloud is not cloud native.

Let's compare, with illustrative prices. The platform needs forty virtual CPUs all day, and a hundred and twenty for the four hour evening rush. On-demand capacity costs four pence per virtual CPU hour; a three year commitment, two point four pence. Option A rents a hundred and twenty virtual CPUs all month, sized for the peak. That's three thousand five hundred and four pounds a month. Option B commits to the forty always needed, for seven hundred and one pounds, and adds eighty only during the rush, for three hundred and ninety. That's one thousand and ninety one pounds, less than a third of option A. Option C owns hardware sized for the peak, at one point two pence per virtual CPU hour plus thirty per cent headroom. With a quarter of an engineer's time, it's three thousand and thirty four pounds. But at a steady two thousand virtual CPUs, owning becomes about sixteen per cent cheaper than committed cloud. That's the situation of 37signals, which moved its steady workloads onto its own servers and reported saving about two million dollars a year.

The method matters more than the numbers. Model the shape of the load: elasticity wins for small, spiky workloads, and ownership can win for large, flat ones. Count people and headroom honestly, and compare with the best cloud price, including commitments, not the list price. And choose per workload. One company can sensibly use SaaS for payroll, functions for image resizing and containers for its core services.

The full section has more on managed services and regions, and a decision guide for choosing a hosting model. Next, in Section ten point two, we look at containers, and how Kubernetes keeps them running. See you there.

What you need to know

From one definition to many models

Chapter 0 introduced servers and the cloud: the NIST definition (Special Publication 800-145, 2011), with its five essential characteristics of on-demand self-service, broad network access, resource pooling, rapid elasticity and measured service, and the idea that service models hand more or less of the stack to a provider. This section takes those ideas to the depth an architect needs to choose where a system runs and to defend the choice.

NIST defines three service models (infrastructure, platform and software as a service) and four deployment models: public (open to anyone, owned by a provider), private (for one organisation, wherever it is located and whoever operates it), community (shared by organisations with common concerns, such as government bodies) and hybrid (two or more of these, bound together so that data and applications can move between them). The industry has since added functions and containers as a service to the service models, and multi-cloud to the deployment vocabulary.

Where software runs is part of what Chapter 1 called the allocation structure of an architecture (defining architecture): the mapping of software onto hardware, networks and organisations. It is significant in the Chapter 1 sense because it is expensive to reverse, and because it fixes much of a system's cost, its availability, its security boundary and how quickly its teams can release.

Service models: who manages what

The service models form a spectrum. At one end you rent bare capacity and do everything above it yourself; at the other you rent a finished application and only configure it. Each step to the right removes operational work and removes choices. The table adds the two models that the NIST document predates: containers as a service and functions as a service.

Service models compared

ModelYou deploy and runThe provider runsExamplesTypical fit
IaaSVirtual machines: operating system, patches, runtime, application, scaling rulesHardware, network, hypervisor, data centreAmazon EC2, Azure Virtual Machines, Google Compute EngineSoftware that needs a particular operating system or kernel, legacy applications moved as they are, full control
CaaS (containers as a service)Container images and their configuration; with managed Kubernetes, also worker-node choices and upgradesContainer control plane, often the nodes too; with serverless containers, all serversAmazon EKS and ECS, Azure Kubernetes Service and Container Apps, Google Kubernetes Engine and Cloud RunMany services built as containers, teams that want portable packaging
PaaSApplication code and its configurationOperating system, runtime, scaling, load balancing, often loggingHeroku, Azure App Service, Google App Engine, AWS Elastic BeanstalkStandard web applications and APIs that fit the platform's conventions
FaaSIndividual functions and the events that trigger themEverything else, including scaling to zero; billing per invocation and durationAWS Lambda, Azure Functions, Google Cloud Run functions, Cloudflare WorkersEvent-driven, spiky or low-volume work in short steps
SaaSConfiguration, users, permissions and your dataThe whole applicationMicrosoft 365, Salesforce, Workday, ZendeskGeneric capabilities that do not differentiate the business

The boundaries blur in practice. Serverless container platforms such as Google Cloud Run and Azure Container Apps run a container image like a PaaS runs code, scaling to zero like a function. Managed Kubernetes can be anything from a hosted control plane, where you still patch and upgrade the worker machines, to a fully managed mode where the provider runs the nodes too. The useful question is never which label applies but which concrete tasks remain yours: patching, scaling decisions, capacity planning, backups, failover, upgrades and on-call response.

A second useful distinction is the unit of deployment and billing. IaaS bills machines by the second or hour whether they are busy or not; FaaS bills invocations and execution time and costs nothing when idle; PaaS and serverless containers sit in between. Chapter 6 explains why per-request pricing is cheaper than always-on capacity below a crossover volume and more expensive above it (serverless architectures). The shape of a workload's load, not its size, decides which side of the crossover it is on.

The shared responsibility model

Every major provider publishes a shared responsibility model. AWS summarises it as the provider being responsible for security of the cloud and the customer for security in the cloud. The provider secures buildings, hardware, the network, the hypervisor and the services it runs; the customer secures what it builds and configures on top. Where the line falls depends on the service model, as the diagram shows.

Who is responsible for what, by service model

Shared responsibility across six hosting models: the customer always owns data and access, and hands more of the lower layers to the provider moving from on-premises to SaaSOn-premown serversIaaSvirtual machinesCaaSmanaged K8sPaaSapp platformFaaSfunctionsSaaSfinished appData and accessYouYouYouYouYouYouApplication codeYouYouYouYouYouProviderRuntime, scalingYouYouSharedProviderProviderProviderOperating systemYouYouSharedProviderProviderProviderVirtualisationYouProviderProviderProviderProviderProviderHardware, networkYouProviderProviderProviderProviderProviderData centreYouProviderProviderProviderProviderProviderYou manage and secure itSharedProvider manages it
Moving right hands lower layers to the provider, but data, identities and access configuration stay with the customer in every model.

Three things never transfer. The customer always owns its data (what is stored, where, for how long, who can read it), its identities and permissions, and the configuration of the services it uses. Many cloud breaches have been customer configuration failures rather than provider failures: object storage left readable by anyone, administrator keys committed to public repositories, overly broad permissions. In 2019, for example, an attacker exploited a misconfigured web application firewall at Capital One to obtain cloud credentials and copy data relating to more than 100 million people in the United States and Canada; the provider's infrastructure behaved as designed.

For an architect, the model is a checklist of work that must be assigned to someone. If a team moves the food-delivery platform's orders database from a virtual machine to a managed database service, patching the database engine moves to the provider, but choosing a maintenance window, testing major version upgrades, granting least-privilege access, enabling encryption and checking that backups can be restored do not. Chapter 8 covers the security principles behind these duties in depth (security principles for architects).

Deployment models and the real reasons behind them

Organisations rarely choose a deployment model for one reason, and the stated reason is not always the real one. It helps to separate the motives that survive scrutiny from the ones that do not.

Public, private, hybrid and multi-cloud

  1. Public cloudChosen for elasticity, speed (a new environment in minutes, not a hardware purchase in months), a large catalogue of managed services and global reach. It suits variable load, new products whose demand is unknown and teams that want to spend their effort on the product rather than on servers.
  2. Private cloudChosen for regulatory or contractual control, predictable steady load, existing data centre investment or very low latency to equipment on site. A private cloud means self-service, API-driven provisioning on dedicated infrastructure (for example with OpenStack, VMware or a vendor's on-premises edition of its public cloud), not merely a virtualised server room where requests still go through a ticket queue.
  3. Hybrid cloudUsually the result of a gradual migration, data that must stay on premises (a mainframe ledger, factory or hospital systems), or edge sites such as shops and warehouses. Bursting from a private data centre into the public cloud at peak times is often promised but rarely practical, because the data the workload needs stays behind and copying it costs time and money.
  4. Multi-cloudUsing two or more public providers. Defensible reasons include using a distinctive service from each provider, acquisitions that arrive on another cloud, negotiating leverage and regulation that demands credible exit plans. In the EU, the Digital Operational Resilience Act (DORA), which applies from January 2025, requires financial entities to have exit strategies for critical ICT providers. Running every workload portably across several clouds is a different and far more expensive goal.

The common error is to adopt multi-cloud as an abstract hedge. Making one workload run identically on two providers means using only the services both offer, building and testing two sets of infrastructure code, staffing skills for both, and often paying data transfer charges between them. That is the lowest-common-denominator trap: you pay the cost of portability every day in exchange for an exit you may never use. Section 10.8 treats lock-in as a trade-off to be priced, not a sin to be avoided at any cost (FinOps, cost architecture and vendor lock-in).

Regions and availability zones as design inputs

A region is a geographic area with its own independent set of data centres; an availability zone is one or more data centres within a region with separate power, cooling and networking, placed far enough from the others that a fire, flood or local power failure affects only one, and close enough for round trips of a few milliseconds at most. Chapter 0 explained the idea. For design, three further points matter.

First, every managed service has a failure scope: zonal resources (a single virtual machine, a disk) die with their zone; regional services (most managed databases in multi-zone mode, object storage, queues) are replicated across zones by the provider; a few global services (DNS, identity, some content delivery and load-balancing services) span regions, which makes their rare outages wide. Knowing which scope each dependency has is the first step in any availability analysis (see availability and reliability).

Second, spreading across zones is the cheap, high-value default. Running the food-delivery platform's stateless services in three zones behind a load balancer, with a database that keeps a synchronous standby in a second zone, survives the loss of a data centre with automatic failover and a small latency cost. Three zones rather than two matter for anything that uses quorums, such as etcd in Kubernetes or a consensus-based database, because a majority must survive. Cross-zone traffic is not always free, though: most large providers charge for data moving between zones, so chatty services spread across zones add a visible line to the bill.

Third, regions are not identical. Newer or smaller regions may lack services, some have fewer zones, prices differ by region, and legal jurisdiction follows the region. Section 10.6 deals with multiple regions, disaster recovery and data residency (multi-region, disaster recovery and edge computing).

Managed services versus self-managed

A managed service is a component (a database, queue, cache, search engine, Kubernetes control plane) that the provider installs, operates, patches, backs up and scales for you. The alternative is to run the same open-source software yourself on virtual machines or in containers. The trade-off is labour and risk against control, cost and portability.

Managed services win when the component is undifferentiated: every food-delivery company needs a reliable PostgreSQL database, but none wins customers because of how it applies database patches. In domain-driven design terms these are generic subdomains, the ones you should buy rather than build. A managed database gives multi-zone failover, point-in-time recovery and minor-version patching that would otherwise need a skilled team on call. Self-management wins when you need a version, extension or tuning parameter the provider does not offer, when the provider's limits or quotas do not fit, when the managed premium becomes large at scale, or when portability across environments matters more than convenience.

Managed does not mean maintenance-free. The provider will force major version upgrades on its own schedule when old versions reach end of support, will change defaults, will impose quotas you discover at the worst moment and will have outages you cannot fix, only wait out. You still own schema design, query performance, capacity choices, cost and the regular test that proves a restore works. Treat each managed service as a dependency with its own failure modes and its own exit cost.

What cloud native means

The Cloud Native Computing Foundation (CNCF), part of the Linux Foundation and home of Kubernetes, publishes the most cited definition of cloud native. Version 1.0 (2018) described technologies that let organisations build and run scalable applications in dynamic environments such as public, private and hybrid clouds, and named containers, service meshes, microservices, immutable infrastructure and declarative APIs as typical examples. Version 1.1, approved in 2024, shifts the emphasis from technologies to practices: developing, building and deploying workloads in a programmatic, repeatable way at scale, characterised by loosely coupled systems that interoperate in a manner that is secure, resilient, manageable, sustainable, and observable.

Two consequences follow. Cloud native describes how a system is built and operated, not where: a Kubernetes cluster in a private data centre, provisioned from code and deployed many times a day, is cloud native; a hand-configured virtual machine copied unchanged into a public cloud is not. And cloud native is a means rather than an end. Its practices (automation, disposable components, declarative configuration, elasticity, observability) pay off when a system needs frequent change, variable scale and high availability; they add cost and complexity for a stable internal tool used by twenty people.

Migrations are often described with the six Rs, which are worth knowing because they set expectations: rehost (lift and shift, unchanged), replatform (small changes such as moving to a managed database), refactor or re-architect (redesign for cloud-native operation), repurchase (replace with SaaS), retain (leave where it is) and retire (switch it off). Rehosting is fast but typically delivers few of the cloud's benefits and, run on always-on machines sized for peak, can cost more than the data centre it left.

When the cloud is not cheaper

The best-known counter-example is 37signals, the company behind Basecamp and HEY. In October 2022 its chief technology officer, David Heinemeier Hansson, announced that it was leaving the cloud, citing an annual AWS bill of more than USD 3 million for workloads with steady, predictable load. It bought roughly USD 700,000 of Dell servers, placed them in rented colocation space and moved its applications off AWS compute during 2023; it reported that this cut its cloud bill by about USD 2 million a year. In 2025 it announced the second stage: moving about 18 petabytes of files from Amazon S3 to roughly USD 1.5 million of storage arrays to replace an S3 bill of about USD 1.5 million a year, with the stated aim of closing its AWS account. The company has projected savings of about USD 10 million over five years. Moving workloads out of the cloud in this way is called cloud repatriation.

Both sides of the argument deserve a hearing. In favour of 37signals' reasoning: its load is steady, so it gained little from elasticity; it already employed experienced operations engineers and reported needing no extra staff; colocation providers handle power, cooling and physical security; and servers can be used for five years or more, so their cost per year of computing is far below on-demand rental. On the other side: 37signals is a mature business with predictable demand, which most new products are not; the comparison depends heavily on what the cloud bill would have been with commitment discounts and right-sizing; owning hardware means capital spending, lead times of weeks or months and capacity bought in advance; and a smaller team without deep operations skills would have to hire them, which can erase the saving. Critics also point out that the savings figures come from the company itself.

Worked example

Worked example: renting or owning compute for the food-delivery platform

All prices are illustrative assumptions chosen to show the method, not real quotations. On-demand cloud capacity costs £0.040 per vCPU-hour; a three-year commitment costs £0.024 (a 40% discount); owned hardware in colocation costs £0.012 per vCPU-hour including power and space, but needs 30% headroom and staff time. The platform needs 40 vCPUs all day, rising to 120 vCPUs for the four-hour evening rush (about 122 hours a month). A month is 730 hours.

A: cloud, sized for peak, always on120 vCPU × 730 h × £0.040 = £3,504 a month
B: cloud, committed baseline plus autoscaled peak40 × 730 × £0.024 = £701; plus 80 × 122 × £0.040 = £390; total £1,091 a month
C: owned hardware sized for peak120 × 1.3 × 730 × £0.012 = £1,367; plus a quarter of an engineer at £80,000 a year = £1,667; total £3,034 a month
Now scale up: a steady 2,000 vCPUs, no rush hourCloud committed: 2,000 × 730 × £0.024 = £35,040. Owned: 2,000 × 1.3 × 730 × £0.012 = £22,776 plus one engineer (£6,667) = £29,443, about 16% cheaper

For a small, spiky workload, elasticity dominates: option B costs less than a third of option A and about a third of option C, because it pays for peak capacity only during the rush.

For a large, flat workload, the fixed costs of ownership are spread over more capacity and ownership starts to win, which is the 37signals situation. The saving is real but smaller than headline comparisons suggest once headroom, staff and migration effort are counted.

The method matters more than the numbers: model the load shape, include people and headroom, compare against the best cloud price (with commitments), not the list price, and repeat the calculation as the business changes.

Decision guide

Decision guide: choosing a hosting model for a workload

Apply it per workload, not once for the whole organisation: a single company sensibly uses SaaS for payroll, functions for image resizing and containers for its core services.

  1. Is the capability generic, with a product on the market that fits well enough (email, payroll, CRM, payments)?
    YesBuy SaaS and integrate through its API; spend design effort on the integration and the exit plan.
    NoContinue: you need to run your own software.
  2. Do law, contract or physical location rule out the public cloud for this workload (strict sovereignty rules, equipment on site, millisecond control loops)?
    YesUse a private cloud, colocation or an on-site edge deployment, connected to public cloud services as a hybrid where allowed.
    NoContinue with public cloud options.
  3. Is the work event-driven, short-lived and spiky or low in volume (webhooks, file processing, scheduled jobs)?
    YesUse functions as a service or a serverless container platform; check cold-start, duration and cost-at-volume limits.
    NoContinue: this is a long-running service.
  4. Does a PaaS or serverless container platform's model fit (stateless HTTP service, standard runtime, few special needs)?
    YesUse it. It removes the most operational work for a small team.
    NoContinue: you need more control.
  5. Do you run many services across several teams, and have (or will fund) a team able to operate Kubernetes?
    YesUse managed Kubernetes (CaaS), ideally behind an internal platform (Section 10.7).
    NoUse virtual machines with managed databases and autoscaling groups, built from infrastructure code.
  6. Is the load large, steady and predictable for years, with operations skills in house?
    YesPrice owned or colocated hardware against committed cloud capacity; repatriation may pay off.
    NoStay on rented capacity and use commitment discounts for the steady baseline.

Check your understanding

A team moves its database from a self-run VM to a managed database service. Name two responsibilities that move to the provider and two that stay with the team.

The provider takes over engine patching, hardware and usually automated backups and zone failover. The team keeps schema and query design, access permissions, encryption choices, capacity and cost, testing restores and planning major-version upgrades.

Why does a quorum-based system such as etcd prefer three availability zones to two?

A quorum needs a majority. With two zones, losing the zone that holds the majority stops the system; with three, any single zone can fail and a majority survives.

Is a hand-built virtual machine copied unchanged into a public cloud cloud native?

No. Cloud native describes practices such as automation, declarative configuration, disposable components and observability, not location. Rehosting moves the system without adopting those practices.

Why might the same organisation sensibly use SaaS, functions and Kubernetes at once?

The hosting model should be chosen per workload: generic capabilities are bought as SaaS, spiky event-driven tasks fit functions, and long-running core services may justify containers on Kubernetes.

Next · 10.2Containers and KubernetesImages, layers, registries and the OCI standards; why orchestration is needed; the Kubernetes control plane, nodes, core objects and reconciliation loops; requests, limits, probes, and when Kubernetes is overkill.Continue →

Sources and further reading

Have a question about this section? ArchitectBot, the course’s AI study assistant, answers from the course first.

Ask: “How do I decide whether our food-delivery services should run on a PaaS, serverless containers or managed Kubernetes?”