Compute
From the full control of EC2 to the full abstraction of Lambda: the more managed the service, the less you operate and the more AWS takes on.
EC2
Elastic Compute Cloud
Resizable virtual machines (instances) in the cloud, running Linux, Windows or macOS.
Key points
- You pick CPU, memory, storage and networking through the instance type.
- An AMI is the image used to launch instances.
- You manage the operating system, patches and installed software.
On the exam
Match the workload to the family: HPC or batch processing, compute optimized; in-memory database, memory optimized.
Instance families
| Family | When to use |
|---|---|
| General purpose | A balance of compute, memory and networking: web servers, code repositories. |
| Compute optimized | High-performance processors: HPC, batch processing, game servers. |
| Memory optimized | Large data sets in memory: in-memory databases, real-time analytics. |
| Accelerated computing | GPUs and other accelerators: machine learning, graphics, floating point calculations. |
| Storage optimized | High sequential access to local data: data warehouses, distributed systems. |
Purchasing options
EC2 pricing
The same server can cost much less depending on how it is bought.
Key points
- Savings Plans and Reserved Instances: up to 72% off in exchange for a 1 or 3 year commitment.
- Spot: up to 90% off using spare capacity, which AWS can reclaim with a 2-minute warning.
- Unused Reserved Instances can be shared across the accounts of an organization.
On the exam
Steady, predictable workload: Savings Plans or Reserved. Tolerates interruption: Spot. Short and unpredictable: On-Demand. Per-server licensing: Dedicated Host.
Options
| Option | Characteristics |
|---|---|
| On-Demand |
|
| Savings Plans |
|
| Reserved Instances |
|
| Spot |
|
| Dedicated Hosts |
|
| Dedicated Instances | Instances on hardware dedicated to one account, without host control. |
| Capacity Reservations | Reserve capacity in a specific AZ, with no term commitment. |
Auto Scaling
Amazon EC2 Auto Scaling
Adds and removes instances automatically to follow demand.
Key points
- Defines minimum, desired and maximum capacity.
- Scales on metrics (e.g. CPU usage), on a schedule or predictively.
- Replaces unhealthy instances.
On the exam
Elasticity on the exam almost always means Auto Scaling.
ELB
Elastic Load Balancing
Distributes incoming traffic across multiple targets in one or more Availability Zones.
Key points
- Application Load Balancer: HTTP and HTTPS, path and host-based routing.
- Network Load Balancer: TCP and UDP, ultra-low latency.
- Gateway Load Balancer: third-party virtual appliances.
- Health checks send traffic only to healthy targets.
On the exam
Spread traffic across instances in multiple AZs: ELB, usually together with Auto Scaling.
Lambda
AWS Lambda
Runs code in response to events without provisioning or managing servers (Function as a Service).
Key points
- Billed by number of requests and execution time.
- Maximum run time of 15 minutes per invocation.
- Triggered by events from S3, API Gateway, DynamoDB, EventBridge and more.
On the exam
"Run code without servers, only when an event happens": Lambda.
Containers
ECS, EKS, Fargate and ECR
Services to run and orchestrate containerized applications.
Key points
- ECS: AWS’s own container orchestrator.
- EKS: managed Kubernetes, in the cloud or on premises.
- Fargate: serverless compute for ECS and EKS, with no instances to manage.
- ECR: a private container image registry.
On the exam
Already on Kubernetes: EKS. Containers without managing servers: Fargate. Storing images: ECR.
Elastic Beanstalk
AWS Elastic Beanstalk
PaaS: you upload the code and the service provisions capacity, load balancing, scaling and monitoring.
Key points
- Supports Java, .NET, PHP, Node.js, Python, Ruby, Go and Docker.
- You keep control over the resources it creates.
- No extra charge: you pay only for the resources used.
On the exam
"A developer just wants to upload code without configuring infrastructure": Elastic Beanstalk.
Lightsail
Amazon Lightsail
Virtual servers, databases and networking with a fixed monthly price and simplified setup.
Key points
- Ready-made blueprints (WordPress, LAMP and more).
- Predictable pricing, ideal for getting started.
- For simple websites, blogs and small applications.
On the exam
"A simple solution with a predictable monthly cost for a small website": Lightsail.
Batch
AWS Batch
Runs batch processing workloads at any scale, provisioning the compute they need.
Key points
- Manages job queues and scheduling.
- Can use EC2, Spot and Fargate.
- For simulations, rendering and analytics.
On the exam
Hundreds of thousands of batch jobs: AWS Batch.