Skip to content
London, United Kingdom · Est. 1994
English

Unit 2: Compute, Storage and Networking

The three core building blocks of any cloud environment: how processing power is provided, how different kinds of data are stored, and how everything is connected securely.

Unit 2 of 5 · about 54 minutes

2.1 Compute: virtual machines and scaling

Compute is the processing power that runs applications. In the cloud, the most familiar form of compute is the virtual machine, often called an instance. Understanding how virtual machines work, how they are sized and how they scale is the foundation for understanding the rest of the cloud.

Virtualisation

A physical server in a data centre has processors, memory, storage and network connections. Virtualisation software, known as a hypervisor, divides that physical server into several virtual machines. Each virtual machine behaves like a separate computer with its own operating system, even though it shares the physical hardware with others. The hypervisor keeps virtual machines isolated from one another, so one customer cannot see another customer's workload.

Virtualisation is what makes resource pooling and self-service possible. Because virtual machines are software, they can be created, copied, resized, moved and deleted in minutes, rather than requiring someone to install new hardware.

Choosing an instance

Cloud providers offer many instance types. They differ mainly in:

  • Processor (CPU) capacity, measured in virtual CPUs, which affects how much computation can happen at once;
  • Memory (RAM), which affects how much data an application can work with quickly;
  • Specialist hardware, such as graphics processors (GPUs) used for AI training, video processing and scientific modelling;
  • Storage and network performance, which matter for databases and data-heavy work.

Providers usually group instances into families, such as general purpose, compute-optimised, memory-optimised and accelerated. A web server for a small website may need a modest general-purpose instance, while a large in-memory database needs a memory-optimised one.

Right-sizing

A common mistake is to choose instances that are far larger than necessary, often because the team copied the specification of an old physical server "to be safe". Because cloud resources are billed by usage, oversized instances waste money every hour they run. Right-sizing means measuring actual use of CPU and memory over a representative period and selecting the smallest instance that meets the need with a sensible margin.

Scaling up and scaling out

There are two basic ways to add capacity:

  1. Vertical scaling (scaling up) means moving to a larger instance with more CPU or memory. It is simple, but there is an upper limit, and resizing often requires a brief restart.
  2. Horizontal scaling (scaling out) means adding more instances and sharing the work between them. It can grow much further and also improves resilience, because the failure of one instance does not stop the service. However, the application must be designed to run on several machines at once.

Cloud platforms support autoscaling, where instances are added or removed automatically according to rules. For example, a rule might add an instance whenever average CPU use stays above a set level for several minutes and remove one when it falls back. Autoscaling allows a ticketing website to cope with a sudden rush when tickets go on sale, then shrink again overnight.

Tip: Always set a maximum as well as a minimum number of instances in an autoscaling rule. Without an upper limit, a fault or an unexpected surge of automated traffic can create a very large bill.

Images and automation

Instances are usually created from a machine image, which is a saved template containing the operating system and often pre-installed software. Using standard, regularly updated images means that every new instance starts in a known, secure state. Many organisations also describe their infrastructure in configuration files, an approach called infrastructure as code, so that environments can be recreated consistently and changes can be reviewed before they are applied.

Treating servers as replaceable

A helpful shift in thinking is to treat cloud servers as replaceable rather than precious. In traditional IT, each server was carefully maintained for years. In the cloud, it is often better to replace a faulty or outdated instance with a fresh one built from a standard image. This depends on keeping important data off the instance itself, which is one reason the storage services in the next lesson matter.

In practice

If your team runs a reporting application on a cloud virtual machine, useful questions include: how busy is it, really, across a typical month? Could a smaller instance cope? Does it need to run at weekends, or could it be scheduled to switch off? If it fails, could we rebuild it quickly from an image and our configuration files? Simple answers to these questions often reduce cost and risk at the same time.

2.2 Storage and databases

Every application needs somewhere to keep data. Cloud providers offer several kinds of storage, each designed for different patterns of use. Choosing the right type affects performance, cost and how safely data is kept. This lesson introduces the main storage types and the databases built on them.

Three main types of storage

TypeHow it worksTypical uses
Block storageBehaves like a hard disk attached to a single virtual machine.Operating system disks, databases running on a server.
File storageA shared network drive with folders, accessible by several machines or users.Shared documents, older applications that expect a file system.
Object storageStores files as objects with metadata in large "buckets", accessed over the web.Images, video, backups, archives, data for analytics, website assets.

Block storage offers fast, consistent performance and is used when an application needs a disk. It is usually tied to one instance at a time.

File storage is familiar to anyone who has used a shared drive. It is convenient when several servers must read and write the same files.

Object storage is one of the most widely used cloud services. It can hold almost unlimited amounts of data at relatively low cost and is highly durable, because providers keep multiple copies across different facilities. Each object has a unique address, and access is controlled through permissions. Object storage is not designed for data that changes many times a second, but it is ideal for large files and long-term retention.

Storage tiers

Providers usually offer storage tiers that trade cost against speed of access. Frequently used data sits in a standard tier. Data that is rarely accessed, such as old invoices kept for legal reasons, can move to cheaper "infrequent access" or "archive" tiers. Archive tiers can be very inexpensive to store but may take hours to retrieve and charge for retrieval. Lifecycle rules can move data between tiers automatically as it ages.

Databases in the cloud

Databases organise data so that it can be searched, updated and analysed efficiently. Two broad families are common:

  • Relational databases store data in tables with rows and columns and use the SQL language. They are well suited to structured business data such as orders, customers and invoices, where consistency is important.
  • Non-relational (NoSQL) databases use other structures, such as documents, key-value pairs or graphs. They are often chosen for very large scale, flexible data formats or particular access patterns, such as storing user profiles for a mobile app.

Most providers offer managed databases, a form of PaaS where the provider handles installation, patching, backups and much of the scaling. This removes a great deal of routine work, although the customer still designs the database, controls access and decides on backup retention.

For analysing large volumes of data, organisations often use a data warehouse, which is optimised for complex queries and reporting, or a data lake, which holds raw data of many kinds in object storage for later analysis.

Durability, availability and backups

Two terms are often confused. Durability is about not losing data; availability is about being able to reach it when needed. Cloud storage is typically very durable, but this does not protect you from your own mistakes. If a user deletes a file or ransomware encrypts data, the provider will faithfully store the damaged version. Backups, versioning and protected copies are still essential.

Remember: Replication is not the same as backup. A replicated copy faithfully reproduces deletions and corruption; a backup lets you go back to an earlier, good state.

Common mistakes

  1. Leaving object storage buckets publicly accessible by accident, which has caused many data exposures.
  2. Keeping everything in the most expensive tier indefinitely.
  3. Never testing whether backups can actually be restored.
  4. Storing important data only on an instance's local disk, which may be lost when the instance is replaced.

In practice

Consider a marketing team that stores thousands of product photographs, a customer database and several years of campaign reports. Photographs fit naturally in object storage, the customer records in a managed relational database with automated backups, and old reports in an archive tier with a lifecycle rule. Asking "how often is this used, how quickly must we retrieve it, and what would happen if it were lost?" leads to sensible storage choices for almost any dataset.

2.3 Cloud networking essentials

Networking connects cloud resources to each other, to the internet and to an organisation's offices and data centres. Cloud networking uses familiar ideas, such as addresses, routes and firewalls, but delivers them as software that customers configure themselves. A basic grasp of these ideas helps you understand how cloud systems are kept available and secure.

Regions and availability zones

As introduced in Unit 1, providers group their data centres into regions, each in a particular geographic area. Within a region there are usually several availability zones. Each zone consists of one or more data centres with independent power, cooling and networking, located far enough apart that a local incident such as a flood or power failure is unlikely to affect more than one, yet close enough for fast connections between them.

Running an application across two or more availability zones is one of the simplest ways to make it resilient. If one zone has a problem, the others can keep serving users. For protection against a whole region failing, which is rare but possible, critical systems may also be prepared to run in a second region.

Virtual networks

Customers create their own private, isolated networks within the provider's cloud, often called a virtual private cloud or virtual network. Inside it, they define:

  • Subnets, which divide the network into sections, typically public subnets for resources that must be reachable from the internet and private subnets for those that must not;
  • Route tables, which decide where network traffic is sent;
  • Gateways, which provide controlled connections to the internet or to other networks.

A common design places web servers or load balancers in a public subnet and keeps application servers and databases in private subnets, so that the database can never be reached directly from the internet.

Controlling traffic

Cloud platforms provide firewall-like controls, often called security groups or network access control lists, which specify which traffic is allowed. Good practice is to allow only the traffic that is needed: for example, permitting web traffic to the load balancer, traffic from the load balancer to the application servers, and traffic from the application servers to the database, and nothing else. This principle of least privilege applies to networks as well as to people.

Tip: Be wary of any rule that allows access "from anywhere" to administrative services or databases. Such rules are a frequent cause of cloud security incidents.

Load balancers and content delivery

A load balancer receives incoming requests and distributes them across several servers. It checks the health of each server and stops sending traffic to any that fail. Load balancers are central to horizontal scaling and high availability.

A content delivery network (CDN) keeps copies of static content, such as images, videos and web pages, in locations around the world close to users. This makes websites faster for distant visitors and reduces the load on the main servers. CDNs often also help absorb large floods of malicious traffic, known as distributed denial-of-service (DDoS) attacks.

The Domain Name System (DNS) translates human-readable names, such as a company's web address, into network addresses. Cloud DNS services can also direct users to the nearest or healthiest location.

Connecting to the organisation

Most organisations need their offices or existing data centres to communicate with their cloud resources. The main options are:

  1. A virtual private network (VPN), which creates an encrypted tunnel over the public internet. It is quick and inexpensive to set up.
  2. A dedicated private connection from the organisation's network to the provider, which offers more consistent performance and does not travel over the public internet, at higher cost.

Many organisations are also moving towards "zero trust" approaches, in which every user and device must prove its identity and permissions for each resource, rather than being trusted simply because it is inside the corporate network.

Data transfer costs

Networking also has a cost dimension. Providers usually charge little or nothing for data coming into the cloud, but they often charge for data leaving it, called egress, and sometimes for data moving between zones or regions. Architectures that move large volumes of data out of the cloud can therefore be more expensive than expected.

In practice

When reviewing a proposed cloud design, you do not need to read every network rule. Instead, ask: which parts are reachable from the internet, and why? Is the application spread across more than one availability zone? How do staff and offices connect to it? How much data will leave the cloud each month? These questions quickly reveal whether resilience, security and cost have been considered.

Case study: Preparing an online shop for a seasonal peak

Thornbury Garden Goods, a fictional retailer of plants and garden tools, ran its online shop on a single large virtual machine with the database on the same server. Every spring, when sales tripled, the site slowed down, and one weekend it went offline for several hours.

Working with an external consultant, the small IT team redesigned the setup. The product images moved to object storage behind a content delivery network, so they loaded quickly without burdening the web servers. The database moved to a managed relational service running across two availability zones, with automated daily backups and a tested restore process. The web application now runs on several smaller instances behind a load balancer, with autoscaling set between two and ten instances.

The database was placed in a private subnet that only the application servers could reach. During the next spring peak, the site added instances automatically on busy evenings and reduced them overnight. Monthly costs outside the peak season fell, because the old oversized server had been replaced with smaller instances that matched normal demand.

Activity

Think of an application or website your organisation depends on, or one you use often. Sketch, in words or a simple diagram, how you would host it in the cloud, naming the type of compute, the storage or database you would use and whether it would run in more than one availability zone. Identify which parts should be reachable from the internet and which should not.

Compare with a model answer

A strong answer chooses a realistic application, such as a booking website, and describes a sensible layout. For example: a load balancer in a public subnet receives traffic; two or more web server instances, or a managed application platform, run in private subnets across two availability zones, with autoscaling; a managed relational database holds bookings and customer details; and object storage with a content delivery network serves images and documents.

The answer states clearly that only the load balancer, and perhaps the CDN, is reachable from the internet, while application servers and the database are not. It mentions backups and how often they would be tested. The best answers also note at least one cost consideration, such as data leaving the cloud or right-sizing instances.

Key takeaways

  • Virtual machines are created by dividing physical servers with a hypervisor; choosing and right-sizing instance types has a direct effect on cost and performance.
  • Horizontal scaling and autoscaling allow capacity to follow demand, but autoscaling rules should always have sensible limits.
  • Block, file and object storage suit different needs, and storage tiers and lifecycle rules help keep costs under control.
  • Durable storage is not a backup: versioning, independent backups and tested restores are still required.
  • Availability zones, private subnets, least-privilege traffic rules and load balancers are central to resilient and secure cloud networks.

Unit check

Create a free account to answer the check, save your progress and receive your free certificate.

Create a free account Log in
← Unit 1 Unit 3 →
WhatsApp