Compute services
From a server you manage to a function you only write
EC2 gives you a server. Fargate and Lambda are serverless: nothing to manage.
AWS has many ways to run code, and they line up by how much you manage. EC2 is a virtual server. You choose the size and manage the operating system. Elastic Beanstalk takes a web application and builds the servers, load balancer and scaling for you. ECS and EKS run containers, on servers of yours. Fargate runs containers with no servers for you to see. Lambda runs a single function when an event happens, for up to fifteen minutes, and bills by the millisecond.
Compute services · Going deeper
Clue words for compute
Eight compute services, eight clue phrases.
EC2 instance types
Five families, each named for what it has most of
Match the workload's bottleneck to the family: compute, memory, storage or accelerated.
An EC2 instance comes in hundreds of types, grouped into five families. General purpose: a balance, for web servers and everyday work. Compute optimized: more processor, for batch jobs and modelling. Memory optimized: a great deal of memory, for in-memory databases. Storage optimized: very fast local disks, for data warehouses. Accelerated computing: graphics processors, for machine learning and video. The exam describes the workload and asks for the family.
EC2 instance types · Going deeper
Reading an instance name
m7g.xlarge: family, generation, processor, size.
Containers
ECS or EKS orchestrates; EC2 or Fargate provides the servers
EKS is Kubernetes, ECS is AWS's own, Fargate removes the servers, ECR stores images.
Container questions come down to two choices. The first is the orchestrator: ECS, which is AWS's own and simpler, or EKS, which is managed Kubernetes. The second is who provides the servers. On EC2, you do. On Fargate, nobody you can see: it is serverless. And beside them all is ECR, the registry where container images are kept.
Check yourself
A function resizes an image each time one is uploaded. It runs for two seconds, a few hundred times a day. Which service fits best?
Elasticity
Auto Scaling sets the number; the load balancer shares the load
Auto Scaling provides elasticity. Elastic Load Balancing distributes traffic to healthy targets.
Two services appear together in almost every web architecture. Elastic Load Balancing receives requests from users and shares them out. Behind it is an Auto Scaling group, spread across two Availability Zones. Two servers are always on: that is the minimum. When average processor use passes sixty percent, Auto Scaling launches more, up to the maximum, and terminates them when demand falls. That is elasticity. It also replaces any instance that becomes unhealthy.
Elasticity · Going deeper
Kinds of load balancer and ways to scale
Application load balancers for HTTP; Network load balancers for raw speed.
VPC
Your private network: subnets, route tables and gateways
A subnet is public only when it routes to an internet gateway; private subnets go out through NAT.
Everything you launch sits in a network of your own. A Virtual Private Cloud, or VPC, is a private network in one Region, with an address range you choose. It is divided into subnets. A public subnet holds what must face the internet, such as a load balancer. A private subnet holds application servers and databases. An internet gateway connects the VPC to the internet; a subnet is public only if its route table points there. Private servers reach out, for updates, through a NAT gateway. And your office can join the network by VPN or Direct Connect.
VPC · Going deeper
Security groups and network ACLs
Security group: instance, stateful. Network ACL: subnet, stateless, can deny.
Check yourself
An address range must be blocked from reaching anything in one subnet. Which control can do it?
Connecting to AWS
A VPN crosses the internet; Direct Connect goes around it
Site-to-Site VPN: encrypted, over the internet, fast to set up. Direct Connect: dedicated and private.
A hybrid company needs a link between its data centre and its VPC. There are two. A Site-to-Site VPN is an encrypted tunnel over the public internet. It is ready in minutes, and its speed depends on the internet that day. Direct Connect is a dedicated private line from your premises into AWS. It never touches the internet, it takes weeks to install, and its performance is consistent.
Connecting to AWS · Going deeper
Clue words for networking
Transit Gateway is the hub; PrivateLink keeps traffic off the internet.
Route 53
It answers "where?", and never carries the traffic
Amazon Route 53 is DNS: names to addresses, with health checks and routing policies.
The last network service is the first one a user touches. The user's device asks: where is shop dot example dot com? Route 53, the DNS service, receives the question. It replies with an address, and it chooses a healthy one. Only then does the real request travel, to CloudFront at the edge, then the load balancer, then the servers. Route 53 can also register the domain, fail over to another Region when a health check fails, and route by latency, geography or weight.
Check yourself
A company needs a private, dedicated connection from its data centre to AWS with consistent performance. Which service?
Lesson complete
You finished “Compute and networking on AWS”
Answer the questions along the way to see your score here.